From 083b7bab01e8c57ca50927fdf9d3d4d8d45068a4 Mon Sep 17 00:00:00 2001 From: Fabrice Bellard Date: Mon, 7 Apr 2025 12:02:01 +0200 Subject: [PATCH] Fix UB in BigInt left shift (saghul) --- quickjs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickjs.c b/quickjs.c index ae827ed..702ea8f 100644 --- a/quickjs.c +++ b/quickjs.c @@ -13857,7 +13857,7 @@ static no_inline __exception int js_binary_logic_slow(JSContext *ctx, goto bigint_sar; } bigint_shl: - vd = (js_sdlimb_t)v1 << v2; + vd = (js_dlimb_t)v1 << v2; if (likely(vd >= JS_SHORT_BIG_INT_MIN && vd <= JS_SHORT_BIG_INT_MAX)) { v = vd;