From 6a607751bf1ad75eb2909342f4649c8ee812ba8f Mon Sep 17 00:00:00 2001 From: Akos Kiss Date: Fri, 29 May 2015 14:41:46 +0200 Subject: [PATCH] Terminate with signal in case of an assert Automated debugging is easier if the process terminates with a signal instead of a regular `exit (code);` call, since in this latter case the cause of error cannot be automatically backtraced. JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu --- jerry-core/jrt/jrt-fatals.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/jerry-core/jrt/jrt-fatals.cpp b/jerry-core/jrt/jrt-fatals.cpp index 4e9ba628e9..d587f92f07 100644 --- a/jerry-core/jrt/jrt-fatals.cpp +++ b/jerry-core/jrt/jrt-fatals.cpp @@ -62,7 +62,14 @@ jerry_fatal (jerry_fatal_code_t code) /**< status code */ } #endif /* !JERRY_NDEBUG */ - exit (code); + if (code == ERR_FAILED_INTERNAL_ASSERTION) + { + abort (); + } + else + { + exit (code); + } } /* jerry_fatal */ /**