From 09e2bdbb0a55ee326b1520069ed5409bebcc331d Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Thu, 9 Dec 2010 22:48:01 +0100 Subject: [PATCH] FFI: Always specialize to the field name for struct access. --- src/lj_crecord.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lj_crecord.c b/src/lj_crecord.c index 566c064b..a543ffd1 100644 --- a/src/lj_crecord.c +++ b/src/lj_crecord.c @@ -352,6 +352,8 @@ void LJ_FASTCALL recff_cdata_index(jit_State *J, RecordFFData *rd) } } else if (tref_isstr(idx)) { GCstr *name = strV(&rd->argv[1]); + /* Always specialize to the field name. */ + emitir(IRTG(IR_EQ, IRT_STR), idx, lj_ir_kstr(J, name)); if (ctype_isstruct(ct->info)) { CTSize fofs; CType *fct = lj_ctype_getfield(cts, ct, name, &fofs);