summaryrefslogtreecommitdiff
path: root/src/lj_cdata.c
diff options
context:
space:
mode:
authorMike Pall <mike>2010-12-30 12:16:25 +0100
committerMike Pall <mike>2010-12-30 12:16:25 +0100
commit4668b229de64a839857391808c90f92290125ad8 (patch)
treec5ed7341b02e478c636c4422d3968a00c0e44a39 /src/lj_cdata.c
parent158de60b8c5a46b3f00c00ae54ed026ef46487b3 (diff)
downloadluajit2-4668b229de64a839857391808c90f92290125ad8.tar.gz
FFI: Add missing GC steps for implicit allocations.
Diffstat (limited to 'src/lj_cdata.c')
-rw-r--r--src/lj_cdata.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/lj_cdata.c b/src/lj_cdata.c
index 499dbc4d..71453e27 100644
--- a/src/lj_cdata.c
+++ b/src/lj_cdata.c
@@ -154,16 +154,15 @@ static void cdata_getconst(CTState *cts, TValue *o, CType *ct)
}
/* Get C data value and convert to TValue. */
-void lj_cdata_get(CTState *cts, CType *s, TValue *o, uint8_t *sp)
+int lj_cdata_get(CTState *cts, CType *s, TValue *o, uint8_t *sp)
{
CTypeID sid;
if (ctype_isconstval(s->info)) {
cdata_getconst(cts, o, s);
- return;
+ return 0; /* No GC step needed. */
} else if (ctype_isbitfield(s->info)) {
- lj_cconv_tv_bf(cts, s, o, sp);
- return;
+ return lj_cconv_tv_bf(cts, s, o, sp);
}
/* Get child type of pointer/array/field. */
@@ -183,7 +182,7 @@ void lj_cdata_get(CTState *cts, CType *s, TValue *o, uint8_t *sp)
while (ctype_isattrib(s->info) || ctype_isenum(s->info))
s = ctype_child(cts, s);
- lj_cconv_tv_ct(cts, s, sid, o, sp);
+ return lj_cconv_tv_ct(cts, s, sid, o, sp);
}
/* -- C data setters ------------------------------------------------------ */