[opengtl-commits] [660] more d->compiler == 0 stuff for the expression test

[ Thread Index | Date Index | More lists.tuxfamily.org/opengtl-commits Archives ]


Revision: 660
Author:   cyrille
Date:     2009-03-18 22:19:23 +0100 (Wed, 18 Mar 2009)

Log Message:
-----------
more d->compiler == 0 stuff for the expression test

Modified Paths:
--------------
    trunk/OpenGTL/OpenGTL/GTLCore/ParserBase_p.cpp


Modified: trunk/OpenGTL/OpenGTL/GTLCore/ParserBase_p.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/ParserBase_p.cpp	2009-03-18 20:31:03 UTC (rev 659)
+++ trunk/OpenGTL/OpenGTL/GTLCore/ParserBase_p.cpp	2009-03-18 21:19:23 UTC (rev 660)
@@ -1513,28 +1513,31 @@
     return 0;
     
   } else {
-    std::pair<AST::Expression*, AST::Expression*>  ce = d->compiler->convertCenter()->createConvertExpressions( lhs, rhs );
-    if( not ce.first or not ce.second )
+    if( d->compiler )
     {
-      GTL_DEBUG( "Convert from (" << *lhs->type() << ", " << *rhs->type() << " ) failed.");
-      reportError( "Can do a binary operation only on two numbers", token );
-      if(ce.first)
+      std::pair<AST::Expression*, AST::Expression*>  ce = d->compiler->convertCenter()->createConvertExpressions( lhs, rhs );
+      if( not ce.first or not ce.second )
       {
-        delete ce.first;
-      } else {
-        delete lhs;
+        GTL_DEBUG( "Convert from (" << *lhs->type() << ", " << *rhs->type() << " ) failed.");
+        reportError( "Can do a binary operation only on two numbers", token );
+        if(ce.first)
+        {
+          delete ce.first;
+        } else {
+          delete lhs;
+        }
+        if(ce.second)
+        {
+          delete ce.second;
+        } else {
+          delete rhs;
+        }
+        return 0;
       }
-      if(ce.second)
-      {
-        delete ce.second;
-      } else {
-        delete rhs;
-      }
-      return 0;
+      GTL_DEBUG( "Convert from (" << *lhs->type() << ", " << *rhs->type() << " ) to ( " << *ce.first->type() << ", " << *ce.second->type() << " )" );
+      lhs = ce.first;
+      rhs = ce.second;
     }
-    GTL_DEBUG( "Convert from (" << *lhs->type() << ", " << *rhs->type() << " ) to ( " << *ce.first->type() << ", " << *ce.second->type() << " )" );
-    lhs = ce.first;
-    rhs = ce.second;
     GTL_ASSERT( lhs->type() == rhs->type() );
     switch( token.type )
     {


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/