Browse Source

FFI: Always specialize to the field name for struct access.

Mike Pall 14 years ago
parent
commit
09e2bdbb0a
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/lj_crecord.c

+ 2 - 0
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);