Merge branch 'master' into v2.1

This commit is contained in:
Mike Pall 2014-11-03 21:35:52 +01:00
commit 42ed4e53a5

View File

@ -125,7 +125,8 @@ collect_attrib:
integer_key: integer_key:
if (ctype_ispointer(ct->info)) { if (ctype_ispointer(ct->info)) {
CTSize sz = lj_ctype_size(cts, ctype_cid(ct->info)); /* Element size. */ CTSize sz = lj_ctype_size(cts, ctype_cid(ct->info)); /* Element size. */
if (sz != CTSIZE_INVALID) { if (sz == CTSIZE_INVALID)
lj_err_caller(cts->L, LJ_ERR_FFI_INVSIZE);
if (ctype_isptr(ct->info)) { if (ctype_isptr(ct->info)) {
p = (uint8_t *)cdata_getptr(p, ct->size); p = (uint8_t *)cdata_getptr(p, ct->size);
} else if ((ct->info & (CTF_VECTOR|CTF_COMPLEX))) { } else if ((ct->info & (CTF_VECTOR|CTF_COMPLEX))) {
@ -135,7 +136,6 @@ collect_attrib:
*pp = p + idx*(int32_t)sz; *pp = p + idx*(int32_t)sz;
return ct; return ct;
} }
}
} else if (tviscdata(key)) { /* Integer cdata key. */ } else if (tviscdata(key)) { /* Integer cdata key. */
GCcdata *cdk = cdataV(key); GCcdata *cdk = cdataV(key);
CType *ctk = ctype_raw(cts, cdk->ctypeid); CType *ctk = ctype_raw(cts, cdk->ctypeid);