diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2023-11-01 06:53:16 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-03-02 18:12:24 +0100 |
commit | fe4e8e4e2d22f253270cca071b3ad3ae19a27976 (patch) | |
tree | 5d1105497ecdba240161994dfbc881804422a4c5 /lib | |
parent | 1f7c361d05281d59773d1eaab27a1bad5425bc75 (diff) | |
download | chawan-fe4e8e4e2d22f253270cca071b3ad3ae19a27976.tar.gz |
Fix UB left shift of negative number
Diffstat (limited to 'lib')
-rw-r--r-- | lib/quickjs/quickjs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/quickjs/quickjs.c b/lib/quickjs/quickjs.c index 7492198f..8e691038 100644 --- a/lib/quickjs/quickjs.c +++ b/lib/quickjs/quickjs.c @@ -35015,7 +35015,7 @@ static int JS_WriteBigNum(BCWriterState *s, JSValueConst obj) e = a->expn + 3; else e = a->expn; - e = (e << 1) | a->sign; + e = (e * 2) | a->sign; if (e < INT32_MIN || e > INT32_MAX) { JS_ThrowInternalError(s->ctx, "bignum exponent is too large"); return -1; |