[opengtl-commits] [546] don't crash when one of the values can't be converted |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/opengtl-commits Archives
]
Revision: 546
Author: cyrille
Date: 2008-12-18 22:37:41 +0100 (Thu, 18 Dec 2008)
Log Message:
-----------
don't crash when one of the values can't be converted
Modified Paths:
--------------
trunk/OpenGTL/OpenGTL/GTLCore/ParserBase_p.cpp
Modified: trunk/OpenGTL/OpenGTL/GTLCore/ParserBase_p.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/ParserBase_p.cpp 2008-12-18 21:37:17 UTC (rev 545)
+++ trunk/OpenGTL/OpenGTL/GTLCore/ParserBase_p.cpp 2008-12-18 21:37:41 UTC (rev 546)
@@ -1507,9 +1507,9 @@
} else {
std::pair<AST::Expression*, AST::Expression*> ce = d->compiler->convertCenter()->createConvertExpressions( lhs, rhs );
- GTL_DEBUG( "Convert from (" << *lhs->type() << ", " << *rhs->type() << " ) to ( " << *ce.first->type() << ", " << *ce.second->type() << " )" );
if( not ce.first or not ce.second )
{
+ GTL_DEBUG( "Convert from (" << *lhs->type() << ", " << *rhs->type() << " ) failed.");
reportError( "Can do a binary operation only on two numbers", token );
if(ce.first)
{
@@ -1525,6 +1525,7 @@
}
return 0;
}
+ 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() );