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
+1 -1
View File
@@ -93,7 +93,7 @@ do_number_bitwise_logic (number_bitwise_logic_op op, /**< number bitwise logic o
}
case NUMBER_BITWISE_SHIFT_LEFT:
{
result = (ecma_number_t) (ecma_number_to_int32 (left_number) << (right_uint32 & 0x1F));
result = (ecma_number_t) ((int32_t) ((uint32_t) ecma_number_to_int32 (left_number) << (right_uint32 & 0x1F)));
break;
}
case NUMBER_BITWISE_SHIFT_RIGHT: