From f3c8eeecb56532ddc1252cd191099b285b802f58 Mon Sep 17 00:00:00 2001 From: wangzhikang123 <43208780+wangzhikang123@users.noreply.github.com> Date: Wed, 13 Mar 2019 22:18:35 +0800 Subject: [PATCH] Fix the vm stop checking bug (#2795) when the vm executes VM_OC_LESS operation, the lookahead optimization will cause the by-passing of vm stop checking. Thus we need to disable the optimization here if JERRY_VM_EXEC_STOP is defined. JerryScript-DCO-1.0-Signed-off-by: Wang Zhikang wzk0406@mail.ustc.edu.cn --- jerry-core/vm/vm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jerry-core/vm/vm.c b/jerry-core/vm/vm.c index 40c77adf5..88ac4eb90 100644 --- a/jerry-core/vm/vm.c +++ b/jerry-core/vm/vm.c @@ -2553,7 +2553,7 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */ if (ecma_are_values_integer_numbers (left_value, right_value)) { bool is_less = (ecma_integer_value_t) left_value < (ecma_integer_value_t) right_value; - +#ifndef JERRY_VM_EXEC_STOP /* This is a lookahead to the next opcode to improve performance. * If it is CBC_BRANCH_IF_TRUE_BACKWARD, execute it. */ if (*byte_code_p <= CBC_BRANCH_IF_TRUE_BACKWARD_3 && *byte_code_p >= CBC_BRANCH_IF_TRUE_BACKWARD) @@ -2587,7 +2587,7 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */ continue; } - +#endif /* !JERRY_VM_EXEC_STOP */ *stack_top_p++ = ecma_make_boolean_value (is_less); continue; }