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:
@@ -1185,6 +1185,18 @@ jerry_get_memory_limits (size_t *out_data_bss_brk_limit_p, /**< out: Jerry's max
|
||||
*out_stack_limit_p = CONFIG_MEM_STACK_LIMIT;
|
||||
} /* jerry_get_memory_limits */
|
||||
|
||||
/**
|
||||
* Check whether 'abort' should be called instead of 'exit' upon exiting with non-zero exit code.
|
||||
*
|
||||
* @return true - if 'abort on fail' flag is set,
|
||||
* false - otherwise.
|
||||
*/
|
||||
bool
|
||||
jerry_is_abort_on_fail (void)
|
||||
{
|
||||
return ((jerry_flags & JERRY_FLAG_ABORT_ON_FAIL) != 0);
|
||||
} /* jerry_is_abort_on_fail */
|
||||
|
||||
/**
|
||||
* Register Jerry's fatal error callback
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user