From a2f22cf888a2de0dd195988cc8a15bc9d0ef2002 Mon Sep 17 00:00:00 2001 From: kisbg Date: Tue, 16 Feb 2021 12:48:40 +0100 Subject: [PATCH] Update jerry debugger test-runner (#4597) Now the test-runner will check the jerry (server) return code. Fixed do_eval_at TC crash if jerry was build with --debug option. JerryScript-DCO-1.0-Signed-off-by: bence gabor kis kisbg@inf.u-szeged.hu --- jerry-core/vm/vm.c | 2 ++ tools/runners/run-debugger-test.sh | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/jerry-core/vm/vm.c b/jerry-core/vm/vm.c index 5681d5047..4bcfce2ae 100644 --- a/jerry-core/vm/vm.c +++ b/jerry-core/vm/vm.c @@ -363,6 +363,8 @@ vm_run_eval (ecma_compiled_code_t *bytecode_data_p, /**< byte-code data */ { if (JERRY_UNLIKELY (lex_env_p->u2.outer_reference_cp == JMEM_CP_NULL)) { + ecma_bytecode_deref (bytecode_data_p); + ecma_free_value (this_binding); return ecma_raise_range_error (ECMA_ERR_MSG ("Invalid scope chain index for eval")); } diff --git a/tools/runners/run-debugger-test.sh b/tools/runners/run-debugger-test.sh index 48f437a0e..a3c754c76 100755 --- a/tools/runners/run-debugger-test.sh +++ b/tools/runners/run-debugger-test.sh @@ -37,6 +37,7 @@ fi echo "$START_DEBUG_SERVER" eval "$START_DEBUG_SERVER" +JERRY_PID=$! sleep 1s RESULT_TEMP=`mktemp ${TEST_CASE}.out.XXXXXXXXXX` @@ -53,7 +54,9 @@ STATUS_CODE=$? rm -f ${RESULT_TEMP} -if [ ${STATUS_CODE} -ne 0 ] +wait $JERRY_PID +JERRY_EXIT_CODE=$? +if [ ${STATUS_CODE} -ne 0 ] || [ ${JERRY_EXIT_CODE} -gt 1 ] then echo -e "${TERM_RED}FAIL: ${TEST_CASE}${TERM_NORMAL}\n" else