Skip to content

Commit 3360e35

Browse files
authored
Fix exception printing. (#5012)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg [email protected]
1 parent baf308a commit 3360e35

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

jerry-ext/util/print.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,13 +238,21 @@ jerryx_print_unhandled_exception (jerry_value_t exception) /**< exception value
238238
current_p++;
239239
}
240240

241-
path_str_end_p = (char *) current_p++;
241+
path_str_end_p = (char *) current_p;
242242

243-
err_line = (unsigned int) strtol ((char *) current_p, (char **) &current_p, 10);
243+
if (current_p == string_end_p)
244+
{
245+
break;
246+
}
244247

245-
current_p++;
248+
err_line = (unsigned int) strtol ((char *) current_p + 1, (char **) &current_p, 10);
249+
250+
if (current_p == string_end_p)
251+
{
252+
break;
253+
}
246254

247-
err_col = (unsigned int) strtol ((char *) current_p, NULL, 10);
255+
err_col = (unsigned int) strtol ((char *) current_p + 1, NULL, 10);
248256
break;
249257
}
250258
} /* for */

0 commit comments

Comments
 (0)