diff --git a/HISTORY b/HISTORY index 0bf6670..34127a7 100755 --- a/HISTORY +++ b/HISTORY @@ -1,5 +1,8 @@ +May. 24 2016 +Refactored error raising of string manipulation + May. 20 2016 -Added an assertion when buffer overflow in STR +Added an assertion when buffer overflow in the STR statement May. 19 2016 Added UTF8 BOM detection even with MB_ENABLE_UNICODE disabled diff --git a/core/my_basic.c b/core/my_basic.c index fb048fb..9d594ef 100755 --- a/core/my_basic.c +++ b/core/my_basic.c @@ -14997,9 +14997,7 @@ static int _std_left(mb_interpreter_t* s, void** l) { mb_check(mb_attempt_close_bracket(s, l)); if(count <= 0) { - result = MB_FUNC_ERR; - - goto _exit; + _handle_error_on_obj(s, SE_RN_INDEX_OUT_OF_BOUND, s->source_file, DON2(l), MB_FUNC_ERR, _exit, result); } #ifdef MB_ENABLE_UNICODE @@ -15043,9 +15041,7 @@ static int _std_mid(mb_interpreter_t* s, void** l) { mb_check(mb_attempt_close_bracket(s, l)); if(count <= 0 || start < 0 || start >= (int_t)strlen(arg)) { - result = MB_FUNC_ERR; - - goto _exit; + _handle_error_on_obj(s, SE_RN_INDEX_OUT_OF_BOUND, s->source_file, DON2(l), MB_FUNC_ERR, _exit, result); } #ifdef MB_ENABLE_UNICODE @@ -15087,9 +15083,7 @@ static int _std_right(mb_interpreter_t* s, void** l) { mb_check(mb_attempt_close_bracket(s, l)); if(count <= 0) { - result = MB_FUNC_ERR; - - goto _exit; + _handle_error_on_obj(s, SE_RN_INDEX_OUT_OF_BOUND, s->source_file, DON2(l), MB_FUNC_ERR, _exit, result); } #ifdef MB_ENABLE_UNICODE diff --git a/output/my_basic.exe b/output/my_basic.exe index 86d9ca2..428425f 100755 Binary files a/output/my_basic.exe and b/output/my_basic.exe differ