mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
Avoid conversion narrowing of arithmetic with large constants.
This commit is contained in:
parent
6627744752
commit
32c1d4751a
@ -284,7 +284,8 @@ static int narrow_conv_backprop(NarrowConv *nc, IRRef ref, int depth)
|
||||
}
|
||||
} else {
|
||||
int32_t k = lj_num2int(n);
|
||||
if (n == (lua_Number)k) { /* Only if constant is really an integer. */
|
||||
/* Only if constant is a small integer. */
|
||||
if (checki16(k) && n == (lua_Number)k) {
|
||||
*nc->sp++ = NARROWINS(NARROW_INT, 0);
|
||||
*nc->sp++ = (NarrowIns)k;
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user