From c6a2fd5d3d93efe4bb55613182e06e451fee63b0 Mon Sep 17 00:00:00 2001 From: Daniel Balla Date: Tue, 11 Dec 2018 18:51:00 +0100 Subject: [PATCH] Fix an issue while debugging with static snapshots (#2606) The issue was found when debugging IoT.js with static snapshots turned on, if an error was thrown an assertion failure was caused. The reason is the frame context's bytecode_header_p pointer was not a heap pointer. The jerry_debugger_breakpoint_hit function tries to set a compressed pointer which points to bytecode_header_p with the JMEM_CP_SET_NON_NULL_POINTER macro, which has an assertion that requires the above mentioned bytecode_header_p to be a heap pointer, which is obviously not. Co-authored-by: Robert Fancsik frobert@inf.u-szeged.hu JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu --- jerry-core/vm/vm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jerry-core/vm/vm.c b/jerry-core/vm/vm.c index ffef9deae..2c9962060 100644 --- a/jerry-core/vm/vm.c +++ b/jerry-core/vm/vm.c @@ -3240,7 +3240,8 @@ error: | JERRY_DEBUGGER_VM_EXCEPTION_THROWN); if ((JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED) - && !(frame_ctx_p->bytecode_header_p->status_flags & CBC_CODE_FLAGS_DEBUGGER_IGNORE) + && !(frame_ctx_p->bytecode_header_p->status_flags + & (CBC_CODE_FLAGS_DEBUGGER_IGNORE | CBC_CODE_FLAGS_STATIC_FUNCTION)) && !(JERRY_CONTEXT (debugger_flags) & dont_stop)) { /* Save the error to a local value, because the engine enters breakpoint mode after,