Skip to content

Commit 7f14a28

Browse files
committed
Fix logging of error message in jerry_fatal
As the comment of syscall error mentions, we should not try to log (or print) anything in that case. JerryScript-DCO-1.0-Signed-off-by: Akos Kiss [email protected]
1 parent ce8abfb commit 7f14a28

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

jerry-core/jrt/jrt-fatals.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,11 @@ void __noreturn
3434
jerry_fatal (jerry_fatal_code_t code) /**< status code */
3535
{
3636
#ifndef JERRY_NDEBUG
37-
jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Error: ");
38-
3937
switch (code)
4038
{
4139
case ERR_OUT_OF_MEMORY:
4240
{
43-
jerry_port_log (JERRY_LOG_LEVEL_ERROR, "ERR_OUT_OF_MEMORY\n");
41+
jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Error: ERR_OUT_OF_MEMORY\n");
4442
break;
4543
}
4644
case ERR_SYSCALL:
@@ -50,17 +48,17 @@ jerry_fatal (jerry_fatal_code_t code) /**< status code */
5048
}
5149
case ERR_REF_COUNT_LIMIT:
5250
{
53-
jerry_port_log (JERRY_LOG_LEVEL_ERROR, "ERR_REF_COUNT_LIMIT\n");
51+
jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Error: ERR_REF_COUNT_LIMIT\n");
5452
break;
5553
}
5654
case ERR_UNIMPLEMENTED_CASE:
5755
{
58-
jerry_port_log (JERRY_LOG_LEVEL_ERROR, "ERR_UNIMPLEMENTED_CASE\n");
56+
jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Error: ERR_UNIMPLEMENTED_CASE\n");
5957
break;
6058
}
6159
case ERR_FAILED_INTERNAL_ASSERTION:
6260
{
63-
jerry_port_log (JERRY_LOG_LEVEL_ERROR, "ERR_FAILED_INTERNAL_ASSERTION\n");
61+
jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Error: ERR_FAILED_INTERNAL_ASSERTION\n");
6462
break;
6563
}
6664
}

0 commit comments

Comments
 (0)