[debugger]crash fixed when an execution finished after a Step Out 30/21430/1
Cedric Delamarre [Thu, 5 Mar 2020 09:55:44 +0000 (10:55 +0100)]
Change-Id: Idebf7143806584f7e8faaa5fdf7e6918ca5d24ce

scilab/modules/ast/src/cpp/ast/debuggervisitor.cpp

index 54a98bd..1f0ce45 100644 (file)
@@ -457,6 +457,13 @@ void DebuggerVisitor::visit(const SeqExp  &e)
 bool getMacroSourceFile(std::string* filename)
 {
     const std::vector<ConfigVariable::WhereEntry>& lWhereAmI = ConfigVariable::getWhere();
+    // "Where" can be empty at the end of script execution
+    // this function is called when the script ends after a step out
+    if(lWhereAmI.empty())
+    {
+        return false;
+    }
+
     std::string file = scilab::UTF8::toUTF8(*lWhereAmI.back().m_file_name);
     if (file.rfind(".bin") != std::string::npos)
     {