From: Mike Pall Date: Thu, 9 Dec 2010 21:48:01 +0000 (+0100) Subject: FFI: Always specialize to the field name for struct access. X-Git-Tag: v2.0.0-beta6~149 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=09e2bdbb0a55ee326b1520069ed5409bebcc331d;p=thirdparty%2FLuaJIT.git FFI: Always specialize to the field name for struct access. --- 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);