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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user