[bug_9571] concatenation fixed 34/18734/3
Cedric Delamarre [Fri, 2 Dec 2016 10:36:18 +0000 (11:36 +0100)]
  * test_run core bug_9571

Change-Id: I74f423224f0e368501f41578803bcd57e8b53824

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

index b968551..91cc64b 100644 (file)
@@ -131,10 +131,30 @@ void RunVisitorT<T>::visitprivate(const MatrixExp &e)
 
                 if (pIT->isGenericType() == false)
                 {
-                    pIT->killMe();
-                    std::wostringstream os;
-                    os << _W("unable to concatenate\n");
-                    throw ast::InternalError(os.str(), 999, (*col)->getLocation());
+                    if (poRow == NULL)
+                    {
+                        //first loop
+                        poRow = pIT;
+                    }
+                    else
+                    {
+                        try
+                        {
+                            poRow = callOverloadMatrixExp(L"c", poRow, pIT);
+                        }
+                        catch (const InternalError& error)
+                        {
+                            if (poResult)
+                            {
+                                poResult->killMe();
+                            }
+
+                            pIT->killMe();
+                            throw error;
+                        }
+                    }
+
+                    continue;
                 }
 
                 types::GenericType* pGT = pIT->getAs<types::GenericType>();