Skip to content

Commit

Permalink
Terminate with signal in case of an assert
Browse files Browse the repository at this point in the history
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 [email protected]
  • Loading branch information
akosthekiss committed Jun 3, 2015
1 parent a838461 commit 6a60775
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion jerry-core/jrt/jrt-fatals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

/**
Expand Down

0 comments on commit 6a60775

Please sign in to comment.