AssignExp fixed about resume with a CallExp as left expression. 32/17732/3
Cedric Delamarre [Wed, 27 Jan 2016 15:01:21 +0000 (16:01 +0100)]
test_run core bug_1384

Change-Id: I872d3c9ea4762b18b78d2578d10bb3a3d3e4a89b

scilab/modules/ast/src/cpp/ast/run_AssignExp.hpp

index 02ba782..93e71ff 100644 (file)
@@ -240,6 +240,14 @@ void RunVisitorT<T>::visitprivate(const AssignExp  &e)
             //x(?) = ?
             types::InternalType *pOut = NULL;
 
+            if (e.getRightExp().isReturnExp())
+            {
+                // We can't put in the previous scope a variable create like that : a(2)=resume(1)
+                std::wostringstream os;
+                os << _W("Indexing not allowed for output arguments of resume.\n");
+                throw ast::InternalError(os.str(), 79, e.getLeftExp().getLocation());
+            }
+
             /*getting what to assign*/
             types::InternalType* pITR = e.getRightVal();
             if (pITR == NULL)