Coverity #1321200 fixed 57/18257/3
Dhruv Khattar [Fri, 17 Jun 2016 11:07:18 +0000 (16:07 +0530)]
Change-Id: Ic8c2af03f4935ce6b22a9a646708628f32b29a81

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

index abe7635..76e0c7e 100644 (file)
@@ -334,6 +334,25 @@ void RunVisitorT<T>::visitprivate(const LogicalOpExp &e)
         if (pResult == NULL)
         {
             // We did not have any algorithm matching, so we try to call OverLoad
+            e.getRight().accept(*this);
+            pITR = getResult();
+            if (isSingleResult() == false)
+            {
+                clearResult();
+                std::wostringstream os;
+                os << _W("Incompatible output argument.\n");
+                //os << ((Location)e.right_get().getLocation()).getLocationString() << std::endl;
+                throw ast::InternalError(os.str(), 999, e.getRight().getLocation());
+            }
+
+            if (pITR->getType() == types::InternalType::ScilabImplicitList)
+            {
+                types::ImplicitList* pIR = pITR->getAs<types::ImplicitList>();
+                if (pIR->isComputable())
+                {
+                    pITR = pIR->extractFullMatrix();
+                }
+            }
             pResult = callOverloadOpExp(e.getOper(), pITL, pITR);
         }