Make exit behaviour of jerry_fatal flag-dependent
* Added new flag `JERRY_FLAG_ABORT_ON_FAIL`. * Added new internal api function `jerry_is_abort_on_fail` to check the status of the flag. * Changed `jerry_fatal` bail-out function to call `abort` when the flag is set and exit code is non-zero (i.e., not only for assertion failures). * Added `--abort-on-fail` command line option to linux and nuttx apps to set the flag. JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
This commit is contained in:
@@ -20,6 +20,9 @@
|
||||
#include "jrt.h"
|
||||
#include "jrt-libc-includes.h"
|
||||
|
||||
#define JERRY_INTERNAL
|
||||
#include "jerry-internal.h"
|
||||
|
||||
/*
|
||||
* Exit with specified status code.
|
||||
*
|
||||
@@ -62,7 +65,7 @@ jerry_fatal (jerry_fatal_code_t code) /**< status code */
|
||||
}
|
||||
#endif /* !JERRY_NDEBUG */
|
||||
|
||||
if (code == ERR_FAILED_INTERNAL_ASSERTION)
|
||||
if (code != 0 && jerry_is_abort_on_fail ())
|
||||
{
|
||||
abort ();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user