Merge branch 'master' into v2.1

master
Mike Pall 2013-09-08 03:10:47 +02:00
commit 0d41601e76
2 changed files with 2 additions and 2 deletions

View File

@ -658,7 +658,7 @@ LJLIB_CF(ffi_string) LJLIB_REC(.)
TValue *o = lj_lib_checkany(L, 1);
const char *p;
size_t len;
if (o+1 < L->top) {
if (o+1 < L->top && !tvisnil(o+1)) {
len = (size_t)ffi_checkint(L, 2);
lj_cconv_ct_tv(cts, ctype_get(cts, CTID_P_CVOID), (uint8_t *)&p, o,
CCF_ARG(1));

View File

@ -1535,7 +1535,7 @@ void LJ_FASTCALL recff_ffi_string(jit_State *J, RecordFFData *rd)
TRef tr = J->base[0];
if (tr) {
TRef trlen = J->base[1];
if (trlen) {
if (!tref_isnil(trlen)) {
trlen = crec_toint(J, cts, trlen, &rd->argv[1]);
tr = crec_ct_tv(J, ctype_get(cts, CTID_P_CVOID), 0, tr, &rd->argv[0]);
} else {