Initialize unused value when specializing to cdata metatable.

Reported by jakitliang. #1354
This commit is contained in:
Mike Pall 2025-04-07 09:22:07 +02:00
parent 85c3f2fb6f
commit e9e4b6d302

View File

@ -854,7 +854,10 @@ int lj_record_mm_lookup(jit_State *J, RecordIndex *ix, MMS mm)
return 0; /* No metamethod. */ return 0; /* No metamethod. */
} }
/* The cdata metatable is treated as immutable. */ /* The cdata metatable is treated as immutable. */
if (LJ_HASFFI && tref_iscdata(ix->tab)) goto immutable_mt; if (LJ_HASFFI && tref_iscdata(ix->tab)) {
mix.tab = TREF_NIL;
goto immutable_mt;
}
ix->mt = mix.tab = lj_ir_ktab(J, mt); ix->mt = mix.tab = lj_ir_ktab(J, mt);
goto nocheck; goto nocheck;
} }