Fix cleanup in VM_OC_INITIALIZER_PUSH_PROP on abrupt completion (#4564)

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
Robert Fancsik 2021-02-04 16:05:56 +01:00 committed by GitHub
parent 9ca046b670
commit feb2855f0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View File

@ -2544,7 +2544,7 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
case VM_OC_INITIALIZER_PUSH_PROP:
{
ecma_value_t *last_context_end_p = VM_LAST_CONTEXT_END ();
right_value = last_context_end_p[-2];
ecma_value_t base = last_context_end_p[-2];
if (opcode == CBC_EXT_INITIALIZER_PUSH_PROP)
{
@ -2557,7 +2557,7 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
stack_top_p--;
}
result = vm_op_get_value (right_value, left_value);
result = vm_op_get_value (base, left_value);
if (ECMA_IS_VALUE_ERROR (result))
{

View File

@ -237,3 +237,14 @@ try {
} catch (e) {
assert (e instanceof SyntaxError);
}
var abruptObj = Object.defineProperty({}, 'a', {
get() { throw 5.2; }
});
try {
const { a } = abruptObj;
assert (false);
} catch (e) {
assert (e === 5.2);
}