Fixed dirty hack in parser to distinguish between serial numbers and pointers.
authorJens Vollinga <jensv@balin.nikhef.nl>
Fri, 31 Jul 2009 12:41:08 +0000 (14:41 +0200)
committerJens Vollinga <jensv@balin.nikhef.nl>
Fri, 31 Jul 2009 12:41:08 +0000 (14:41 +0200)
ginac/parser/parser.cpp

index d91b7e8..8f663d1 100644 (file)
@@ -68,14 +68,14 @@ ex parser::parse_identifier_expr()
        }
        // dirty hack to distinguish between serial numbers of functions and real
        // pointers.
-       ex ret;
        try {
-               ret = GiNaC::function(reinterpret_cast<unsigned>(reader->second), args);
+               GiNaC::function f(reinterpret_cast<unsigned>(reader->second), args);
+               return f;
        }
        catch ( std::runtime_error ) {
-               ret = reader->second(args);
+               ex ret = reader->second(args);
+               return ret;
        }
-    return ret;
 }
 
 /// paren_expr:  '(' expression ')'