Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/luajit-rocks.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonan Collobert <ronan@collobert.com>2014-11-04 04:25:23 +0300
committerRonan Collobert <ronan@collobert.com>2014-11-04 04:25:23 +0300
commit0f5edb29dbfe0468f699f5e8ff7595aee0701fcb (patch)
treeb5d118150208871e916ecf190336052df1db1859
parentd0a082bc9a3753f078cc5105b7372184a2405de8 (diff)
Squashed 'luajit-2.1/' changes from d6ff3af..42ed4e5
42ed4e5 Merge branch 'master' into v2.1 a31c317 FFI: No meta fallback when indexing pointer to incomplete struct. git-subtree-dir: luajit-2.1 git-subtree-split: 42ed4e53a525cdd763b3707f6c41d5bd9ec92689
-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 04875fd..164671f 100644
--- a/src/lj_cdata.c
+++ b/src/lj_cdata.c
@@ -125,16 +125,16 @@ collect_attrib:
integer_key:
if (ctype_ispointer(ct->info)) {
CTSize sz = lj_ctype_size(cts, ctype_cid(ct->info)); /* Element size. */
- if (sz != CTSIZE_INVALID) {
- if (ctype_isptr(ct->info)) {
- p = (uint8_t *)cdata_getptr(p, ct->size);
- } else if ((ct->info & (CTF_VECTOR|CTF_COMPLEX))) {
- if ((ct->info & CTF_COMPLEX)) idx &= 1;
- *qual |= CTF_CONST; /* Valarray elements are constant. */
- }
- *pp = p + idx*(int32_t)sz;
- return ct;
+ if (sz == CTSIZE_INVALID)
+ lj_err_caller(cts->L, LJ_ERR_FFI_INVSIZE);
+ if (ctype_isptr(ct->info)) {
+ p = (uint8_t *)cdata_getptr(p, ct->size);
+ } else if ((ct->info & (CTF_VECTOR|CTF_COMPLEX))) {
+ if ((ct->info & CTF_COMPLEX)) idx &= 1;
+ *qual |= CTF_CONST; /* Valarray elements are constant. */
}
+ *pp = p + idx*(int32_t)sz;
+ return ct;
}
} else if (tviscdata(key)) { /* Integer cdata key. */
GCcdata *cdk = cdataV(key);