Skip to content

Commit ca1964e

Browse files
committed
Fix UB in BigInt left shift
1 parent 46bccba commit ca1964e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

quickjs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14305,7 +14305,7 @@ static no_inline __exception int js_binary_logic_slow(JSContext *ctx,
1430514305
goto bigint_sar;
1430614306
}
1430714307
bigint_shl:
14308-
vd = (js_sdlimb_t)v1 << v2;
14308+
vd = (js_dlimb_t)v1 << v2;
1430914309
if (likely(vd >= JS_SHORT_BIG_INT_MIN &&
1431014310
vd <= JS_SHORT_BIG_INT_MAX)) {
1431114311
v = vd;

0 commit comments

Comments
 (0)