Skip to content

Commit a0056ae

Browse files
committed
CONSOLE: Show error if module calls exit()
1 parent 552f67b commit a0056ae

File tree

5 files changed

+11
-1
lines changed

5 files changed

+11
-1
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2023-08-27 (12.27)
2+
COMMON: Fix parameter number error when calling a unit sub/func
3+
COMMON: Show a runtime error if a module calls exit()
4+
15
2023-06-18 (12.27)
26
COMMON: Fix redim regression
37
PLUGINS: Added mechanism for cleaning up resources when the associated map falls out of scope

src/common/sberr.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,10 @@ void err_network() {
379379
rt_raise(ERR_NETWORK);
380380
}
381381

382+
void err_abnormal_exit() {
383+
rt_raise(ERR_ABNORMAL_EXIT);
384+
}
385+
382386
/**
383387
* the DONE message
384388
*/

src/common/sberr.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ void err_array();
7979
void err_form_input();
8080
void err_memory();
8181
void err_network();
82+
void err_abnormal_exit();
8283
void err_throw(const char *fmt, ...);
8384
int err_handle_error(const char *err, var_p_t var);
8485
void inf_done(void);

src/languages/messages.en.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,3 +231,4 @@
231231
#define ERR_DIRWALK_MISSING_USE "DIRWALK: missing USE statement"
232232
#define ERR_DIRWALK_CANT_OPEN "DIRWALK: can't open %s"
233233
#define ERR_LINE_LENGTH "Line length limit exceeded at text: '%s'"
234+
#define ERR_ABNORMAL_EXIT "Abnormal exit"

src/platform/console/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ bool wait_for_file(const char *file, uint32_t modifiedTime) {
400400

401401
static void exit_handler(void) {
402402
if (count_tasks()) {
403-
err_stackunderflow();
403+
err_abnormal_exit();
404404
}
405405
}
406406

0 commit comments

Comments
 (0)