]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
FFI: Always specialize to the field name for struct access.
authorMike Pall <mike>
Thu, 9 Dec 2010 21:48:01 +0000 (22:48 +0100)
committerMike Pall <mike>
Thu, 9 Dec 2010 21:48:01 +0000 (22:48 +0100)
src/lj_crecord.c

index 566c064bfe52a7065cf10e72c6f0680064bcee90..a543ffd14e287701e9b041fe6eb96c5906e93f32 100644 (file)
@@ -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);