From 7af445ec1b047d76cef1a666df67093b82176cd6 Mon Sep 17 00:00:00 2001 From: Wang Renxin Date: Wed, 10 Feb 2016 21:27:38 +0800 Subject: [PATCH] *fixed a wrong loop bug with WHILE and DO statements. --- core/my_basic.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/my_basic.c b/core/my_basic.c index d42faae..c75fd96 100755 --- a/core/my_basic.c +++ b/core/my_basic.c @@ -12549,12 +12549,12 @@ _loop_begin: result = MB_FUNC_OK; goto _exit; - } else if(result == MB_SUB_RETURN) { /* RETURN */ + } else if(result == MB_SUB_RETURN && s->last_routine) { /* RETURN */ if(ast) ast = ast->prev; if(ast) ast = ast->prev; goto _exit; - } else if(result != MB_FUNC_OK) { /* Normally */ + } else if(result != MB_FUNC_OK && result != MB_SUB_RETURN) { /* Normally */ goto _exit; } @@ -12628,12 +12628,12 @@ _loop_begin: result = MB_FUNC_OK; goto _exit; - } else if(result == MB_SUB_RETURN) { /* RETURN */ + } else if(result == MB_SUB_RETURN && s->last_routine) { /* RETURN */ if(ast) ast = ast->prev; if(ast) ast = ast->prev; goto _exit; - } else if(result != MB_FUNC_OK) { /* Normally */ + } else if(result != MB_FUNC_OK && result != MB_SUB_RETURN) { /* Normally */ goto _exit; }