mirror of
https://github.com/bellard/quickjs.git
synced 2025-05-29 01:49:18 +08:00
Fix UB in BigInt left shift (saghul)
This commit is contained in:
parent
fa706d5622
commit
083b7bab01
@ -13857,7 +13857,7 @@ static no_inline __exception int js_binary_logic_slow(JSContext *ctx,
|
|||||||
goto bigint_sar;
|
goto bigint_sar;
|
||||||
}
|
}
|
||||||
bigint_shl:
|
bigint_shl:
|
||||||
vd = (js_sdlimb_t)v1 << v2;
|
vd = (js_dlimb_t)v1 << v2;
|
||||||
if (likely(vd >= JS_SHORT_BIG_INT_MIN &&
|
if (likely(vd >= JS_SHORT_BIG_INT_MIN &&
|
||||||
vd <= JS_SHORT_BIG_INT_MAX)) {
|
vd <= JS_SHORT_BIG_INT_MAX)) {
|
||||||
v = vd;
|
v = vd;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user