aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lj_cdata.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/lj_cdata.c b/src/lj_cdata.c
index 04875fd6..164671fe 100644
--- a/src/lj_cdata.c
+++ b/src/lj_cdata.c
@@ -125,16 +125,16 @@ collect_attrib:
125 integer_key: 125 integer_key:
126 if (ctype_ispointer(ct->info)) { 126 if (ctype_ispointer(ct->info)) {
127 CTSize sz = lj_ctype_size(cts, ctype_cid(ct->info)); /* Element size. */ 127 CTSize sz = lj_ctype_size(cts, ctype_cid(ct->info)); /* Element size. */
128 if (sz != CTSIZE_INVALID) { 128 if (sz == CTSIZE_INVALID)
129 if (ctype_isptr(ct->info)) { 129 lj_err_caller(cts->L, LJ_ERR_FFI_INVSIZE);
130 p = (uint8_t *)cdata_getptr(p, ct->size); 130 if (ctype_isptr(ct->info)) {
131 } else if ((ct->info & (CTF_VECTOR|CTF_COMPLEX))) { 131 p = (uint8_t *)cdata_getptr(p, ct->size);
132 if ((ct->info & CTF_COMPLEX)) idx &= 1; 132 } else if ((ct->info & (CTF_VECTOR|CTF_COMPLEX))) {
133 *qual |= CTF_CONST; /* Valarray elements are constant. */ 133 if ((ct->info & CTF_COMPLEX)) idx &= 1;
134 } 134 *qual |= CTF_CONST; /* Valarray elements are constant. */
135 *pp = p + idx*(int32_t)sz;
136 return ct;
137 } 135 }
136 *pp = p + idx*(int32_t)sz;
137 return ct;
138 } 138 }
139 } else if (tviscdata(key)) { /* Integer cdata key. */ 139 } else if (tviscdata(key)) { /* Integer cdata key. */
140 GCcdata *cdk = cdataV(key); 140 GCcdata *cdk = cdataV(key);