Fix runtime error: left shift (#4912)

This patch fixes #4703
This patch fixes #4702

JerryScript-DCO-1.0-Signed-off-by: Daniel Batiz daniel.batiz@h-lab.eu
This commit is contained in:
batizdaniel
2021-12-23 11:33:21 +01:00
committed by GitHub
parent a63e1d294d
commit a6ab5e9abe
3 changed files with 18 additions and 3 deletions
+2 -1
View File
@@ -3765,7 +3765,8 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
{
ecma_integer_value_t left_integer = ecma_get_integer_from_value (left_value);
ecma_integer_value_t right_integer = ecma_get_integer_from_value (right_value);
*stack_top_p++ = ecma_make_int32_value ((int32_t) (left_integer << (right_integer & 0x1f)));
*stack_top_p++ = ecma_make_int32_value ((int32_t) ((uint32_t) left_integer << (right_integer & 0x1f)));
continue;
}