+added source file information to error handling; *fixed a memory leak.

This commit is contained in:
Wang Renxin 2016-01-17 15:33:10 +08:00
parent 7f81719ba1
commit d290aeb20e
4 changed files with 342 additions and 206 deletions

View File

@ -1,3 +1,7 @@
Jan. 17 2016
Added source file information to error handling
Fixed a memory leak with sub routine which returns a string
Jan. 16 2016 Jan. 16 2016
Added a range of integer syntax for the LIST statement, eg. LIST(m TO n) Added a range of integer syntax for the LIST statement, eg. LIST(m TO n)
Added extra importing directories support to shell Added extra importing directories support to shell

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -1077,10 +1077,13 @@ static void _on_stepped(struct mb_interpreter_t* s, int p, unsigned short row, u
static void _on_error(struct mb_interpreter_t* s, mb_error_e e, char* m, char* f, int p, unsigned short row, unsigned short col, int abort_code) { static void _on_error(struct mb_interpreter_t* s, mb_error_e e, char* m, char* f, int p, unsigned short row, unsigned short col, int abort_code) {
mb_unrefvar(s); mb_unrefvar(s);
mb_unrefvar(f);
mb_unrefvar(p); mb_unrefvar(p);
if(SE_NO_ERR != e) { if(SE_NO_ERR != e) {
_printf("Error:\n [LINE] %d, [COL] %d,\n [CODE] %d, [MESSAGE] %s, [ABORT CODE] %d.\n", row, col, e, m, abort_code); if(f) {
_printf("Error:\n [LINE] %d, [COL] %d, [FILE] %s,\n [CODE] %d, [MESSAGE] %s, [ABORT CODE] %d.\n", row, col, f, e, m, abort_code);
} else {
_printf("Error:\n [LINE] %d, [COL] %d,\n [CODE] %d, [MESSAGE] %s, [ABORT CODE] %d.\n", row, col, e, m, abort_code);
}
} }
} }