]> www.ginac.de Git - ginac.git/blobdiff - ginac/parser/parser.cpp
Fixed the fix in commit f059ebe117d15292e0d262e6e8e232e835c7e33c.
[ginac.git] / ginac / parser / parser.cpp
index 8f663d1879fada9154ac9612ec4020fd5879f424..818203162e7dc4421d61a30af8613e3353b60653 100644 (file)
@@ -68,14 +68,15 @@ ex parser::parse_identifier_expr()
        }
        // dirty hack to distinguish between serial numbers of functions and real
        // pointers.
+       GiNaC::function* f;
        try {
-               GiNaC::function f(reinterpret_cast<unsigned>(reader->second), args);
-               return f;
+               f = new GiNaC::function(reinterpret_cast<unsigned>(reader->second), args);
        }
        catch ( std::runtime_error ) {
                ex ret = reader->second(args);
                return ret;
        }
+       return f->setflag(status_flags::dynallocated);
 }
 
 /// paren_expr:  '(' expression ')'