]> www.ginac.de Git - ginac.git/blobdiff - ginac/function.pl
Allow user defined functions to be parsed.
[ginac.git] / ginac / function.pl
index 1c6ce2972ed3e9ed4ae855c953685c4ff91a7ac4..495432bbff3cd4e8d8fc8b56550a22f474f1a149 100644 (file)
@@ -1388,7 +1388,9 @@ unsigned function::find_function(const std::string &name, unsigned nparams)
 /** Return the print name of the function. */
 std::string function::get_name() const
 {
-       GINAC_ASSERT(serial<registered_functions().size());
+       if ( serial >= registered_functions().size() ) {
+               throw std::runtime_error("unknown function");
+       }
        return registered_functions()[serial].name;
 }