diff options
author | Mike Pall <mike> | 2014-11-03 21:34:24 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2014-11-03 21:34:24 +0100 |
commit | a31c317fb59964be6ab4414fbaea4abebef1c0f5 (patch) | |
tree | a480eb7c0858ae49e734e7be5415cdd13a53de1f | |
parent | 6d0654d3eca7654c9c4f8a9923907d06b177a8a1 (diff) | |
download | luajit-a31c317fb59964be6ab4414fbaea4abebef1c0f5.tar.gz luajit-a31c317fb59964be6ab4414fbaea4abebef1c0f5.tar.bz2 luajit-a31c317fb59964be6ab4414fbaea4abebef1c0f5.zip |
FFI: No meta fallback when indexing pointer to incomplete struct.
-rw-r--r-- | src/lj_cdata.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/lj_cdata.c b/src/lj_cdata.c index 590ddf10..ebaea6d2 100644 --- a/src/lj_cdata.c +++ b/src/lj_cdata.c | |||
@@ -127,16 +127,16 @@ collect_attrib: | |||
127 | integer_key: | 127 | integer_key: |
128 | if (ctype_ispointer(ct->info)) { | 128 | if (ctype_ispointer(ct->info)) { |
129 | CTSize sz = lj_ctype_size(cts, ctype_cid(ct->info)); /* Element size. */ | 129 | CTSize sz = lj_ctype_size(cts, ctype_cid(ct->info)); /* Element size. */ |
130 | if (sz != CTSIZE_INVALID) { | 130 | if (sz == CTSIZE_INVALID) |
131 | if (ctype_isptr(ct->info)) { | 131 | lj_err_caller(cts->L, LJ_ERR_FFI_INVSIZE); |
132 | p = (uint8_t *)cdata_getptr(p, ct->size); | 132 | if (ctype_isptr(ct->info)) { |
133 | } else if ((ct->info & (CTF_VECTOR|CTF_COMPLEX))) { | 133 | p = (uint8_t *)cdata_getptr(p, ct->size); |
134 | if ((ct->info & CTF_COMPLEX)) idx &= 1; | 134 | } else if ((ct->info & (CTF_VECTOR|CTF_COMPLEX))) { |
135 | *qual |= CTF_CONST; /* Valarray elements are constant. */ | 135 | if ((ct->info & CTF_COMPLEX)) idx &= 1; |
136 | } | 136 | *qual |= CTF_CONST; /* Valarray elements are constant. */ |
137 | *pp = p + idx*(int32_t)sz; | ||
138 | return ct; | ||
139 | } | 137 | } |
138 | *pp = p + idx*(int32_t)sz; | ||
139 | return ct; | ||
140 | } | 140 | } |
141 | } else if (tviscdata(key)) { /* Integer cdata key. */ | 141 | } else if (tviscdata(key)) { /* Integer cdata key. */ |
142 | GCcdata *cdk = cdataV(key); | 142 | GCcdata *cdk = cdataV(key); |