Fix UB left shift of negative number
This commit is contained in:
parent
83e6fca8be
commit
4a8372a709
1 changed files with 1 additions and 1 deletions
|
@ -34192,7 +34192,7 @@ static int JS_WriteBigNum(BCWriterState *s, JSValueConst obj)
|
||||||
e = a->expn + 3;
|
e = a->expn + 3;
|
||||||
else
|
else
|
||||||
e = a->expn;
|
e = a->expn;
|
||||||
e = (e << 1) | a->sign;
|
e = (e * 2) | a->sign;
|
||||||
if (e < INT32_MIN || e > INT32_MAX) {
|
if (e < INT32_MIN || e > INT32_MAX) {
|
||||||
JS_ThrowInternalError(s->ctx, "bignum exponent is too large");
|
JS_ThrowInternalError(s->ctx, "bignum exponent is too large");
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Reference in a new issue