summaryrefslogtreecommitdiff
path: root/src/lj_crecord.c
diff options
context:
space:
mode:
authorMike Pall <mike>2014-07-04 18:17:32 +0200
committerMike Pall <mike>2014-07-04 18:17:32 +0200
commitf948fe0c2797bb75ed2147ef86795b082712c96b (patch)
treebe57ad8dd6b1b827b33c77b4fb68cc26b3ee92e4 /src/lj_crecord.c
parenta6c34b85f776d8c83b0c01cbdc50550e613d1fda (diff)
downloadluajit2-f948fe0c2797bb75ed2147ef86795b082712c96b.tar.gz
FFI: Fix compilation of reference field access.
Diffstat (limited to 'src/lj_crecord.c')
-rw-r--r--src/lj_crecord.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lj_crecord.c b/src/lj_crecord.c
index d4b9ddee..2b83f3a1 100644
--- a/src/lj_crecord.c
+++ b/src/lj_crecord.c
@@ -848,8 +848,11 @@ again:
/* Resolve reference for field. */
ct = ctype_get(cts, sid);
- if (ctype_isref(ct->info))
+ if (ctype_isref(ct->info)) {
ptr = emitir(IRT(IR_XLOAD, IRT_PTR), ptr, 0);
+ sid = ctype_cid(ct->info);
+ ct = ctype_get(cts, sid);
+ }
while (ctype_isattrib(ct->info))
ct = ctype_child(cts, ct); /* Skip attributes. */