mirror of
https://github.com/bellard/quickjs.git
synced 2024-11-22 05:38:11 +08:00
Fix UB left shift of negative number
This commit is contained in:
parent
3bb2ca360e
commit
8df4327559
@ -34907,7 +34907,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;
|
||||
|
Loading…
Reference in New Issue
Block a user