[debugger] return statement fix 99/17299/2
Cedric Delamarre [Thu, 8 Oct 2015 16:32:58 +0000 (18:32 +0200)]
function toto()
    return
    disp("toto")
end

debug

e toto

// disp must not be executed

Change-Id: I7a3c457a51995fdd0ddf4b64f5f9ba6d253480df

scilab/modules/ast/src/cpp/ast/runvisitor.cpp

index 8756da4..7c273be 100644 (file)
@@ -611,14 +611,14 @@ void RunVisitorT<T>::visitprivate(const ReturnExp &e)
 {
     if (e.isGlobal())
     {
-        if (ConfigVariable::getEnableDebug() == true)
-        {
-            sciprint(_("%s: function is disable in debug mode.\n"), "resume");
-            return;
-        }
-
         if (ConfigVariable::getPauseLevel() != 0 && symbol::Context::getInstance()->getScopeLevel() == ConfigVariable::getActivePauseLevel())
         {
+            if (ConfigVariable::getEnableDebug() == true)
+            {
+                sciprint(_("%s: function is disable in debug mode.\n"), "resume");
+                return;
+            }
+
             //return or resume
             ConfigVariable::DecreasePauseLevel();
             return;