FFI: Always fall back to metamethods for cdata length/concat.
Thanks to Egor Skriptunoff.
This commit is contained in:
@@ -1443,8 +1443,10 @@ void LJ_FASTCALL recff_cdata_arith(jit_State *J, RecordFFData *rd)
|
||||
}
|
||||
{
|
||||
TRef tr;
|
||||
if (!(tr = crec_arith_int64(J, sp, s, (MMS)rd->data)) &&
|
||||
!(tr = crec_arith_ptr(J, sp, s, (MMS)rd->data)) &&
|
||||
MMS mm = (MMS)rd->data;
|
||||
if ((mm == MM_len || mm == MM_concat ||
|
||||
(!(tr = crec_arith_int64(J, sp, s, mm)) &&
|
||||
!(tr = crec_arith_ptr(J, sp, s, mm)))) &&
|
||||
!(tr = crec_arith_meta(J, sp, s, cts, rd)))
|
||||
return;
|
||||
J->base[0] = tr;
|
||||
|
||||
Reference in New Issue
Block a user