Fix runtime error: left shift of negative value (#4957)

This patch fixes #4701

JerryScript-DCO-1.0-Signed-off-by: Daniel Batiz daniel.batiz@h-lab.eu
This commit is contained in:
batizdaniel
2022-01-20 14:00:47 +01:00
committed by GitHub
parent ac1c48eeff
commit 0ef509458e
2 changed files with 12 additions and 1 deletions
+11
View File
@@ -31,3 +31,14 @@ assert((9 >> 2) === 2);
assert((-14 >> 2) === -4);
assert((9 >>> 2) === (9 >> 2));
assert(("-1.234" << 0) == -1);
assert(("-1.234" << -1) == -2147483648);
assert((-1.2 << 0) === -1);
assert((-1.1 << -1) === -2147483648);
assert((-1.1 << -1.1) === -2147483648);
assert((-1.1 << -999) === -33554432);
assert((-1.1 << 999) === -128);
assert((-33554431.0 << 0) === -33554431);
assert((-33554431.0 << -1.1) === -2147483648);
assert((-33554431.0 << -999) === 33554432);