From f948fe0c2797bb75ed2147ef86795b082712c96b Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Fri, 4 Jul 2014 18:17:32 +0200 Subject: [PATCH] FFI: Fix compilation of reference field access. --- src/lj_crecord.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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. */