* Bug 16204 fixed: for i=1:$, end crashed Scilab
[scilab.git] / scilab / modules / ast / src / cpp / ast / runvisitor.cpp
index 78113c0..8331130 100644 (file)
@@ -662,6 +662,12 @@ void RunVisitorT<T>::visitprivate(const ForExp  &e)
     {
         //get IL
         types::ImplicitList* pVar = pIT->getAs<types::ImplicitList>();
+        if (pVar->isComputable() == false)
+        {
+            std::wostringstream os;
+            os << _W("Invalid index.\n");
+            throw ast::InternalError(os.str(), 999, e.getLocation());
+        }
         //get IL initial Type
         types::InternalType * pIL = pVar->getInitalType();
         //std::cout << "for IL: " << pIL << std::endl;