diff options
Diffstat (limited to 'src/expr/declaration_scope.cpp')
-rw-r--r-- | src/expr/declaration_scope.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/expr/declaration_scope.cpp b/src/expr/declaration_scope.cpp index f36c8a6e3..09aa3ed9f 100644 --- a/src/expr/declaration_scope.cpp +++ b/src/expr/declaration_scope.cpp @@ -21,6 +21,7 @@ #include "expr/declaration_scope.h" #include "expr/expr.h" #include "expr/type.h" +#include "expr/expr_manager_scope.h" #include "context/cdmap.h" #include "context/cdset.h" #include "context/context.h" @@ -48,11 +49,15 @@ DeclarationScope::~DeclarationScope() { delete d_context; } -void DeclarationScope::bind(const std::string& name, Expr obj) throw() { +void DeclarationScope::bind(const std::string& name, Expr obj) throw(AssertionException) { + CheckArgument(!obj.isNull(), obj, "cannot bind to a null Expr"); + ExprManagerScope ems(obj); d_exprMap->insert(name, obj); } -void DeclarationScope::bindDefinedFunction(const std::string& name, Expr obj) throw() { +void DeclarationScope::bindDefinedFunction(const std::string& name, Expr obj) throw(AssertionException) { + CheckArgument(!obj.isNull(), obj, "cannot bind to a null Expr"); + ExprManagerScope ems(obj); d_exprMap->insert(name, obj); d_functions->insert(obj); } |