mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-08 07:34:07 +00:00
FFI: Always specialize to the field name for struct access.
This commit is contained in:
parent
870bcd7640
commit
09e2bdbb0a
@ -352,6 +352,8 @@ void LJ_FASTCALL recff_cdata_index(jit_State *J, RecordFFData *rd)
|
|||||||
}
|
}
|
||||||
} else if (tref_isstr(idx)) {
|
} else if (tref_isstr(idx)) {
|
||||||
GCstr *name = strV(&rd->argv[1]);
|
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)) {
|
if (ctype_isstruct(ct->info)) {
|
||||||
CTSize fofs;
|
CTSize fofs;
|
||||||
CType *fct = lj_ctype_getfield(cts, ct, name, &fofs);
|
CType *fct = lj_ctype_getfield(cts, ct, name, &fofs);
|
||||||
|
Loading…
Reference in New Issue
Block a user