absyntax_utils/search_var_instance_decl.cc
changeset 812 6679b6b21214
parent 810 d9c48ad646f1
child 851 2c59c2b8fca4
--- a/absyntax_utils/search_var_instance_decl.cc	Fri Feb 22 21:09:59 2013 +0000
+++ b/absyntax_utils/search_var_instance_decl.cc	Wed Apr 03 19:49:52 2013 +0100
@@ -105,6 +105,7 @@
   this->current_vartype = none_vt;
   this->current_option  = none_opt;
   this->search_name = get_var_name_c::get_name(variable);
+  if (NULL == search_scope) return NULL; // NOTE: This is not an ERROR! declaration_check_c, for e.g., relies on this returning NULL!
   return (symbol_c *)search_scope->accept(*this);
 }
 
@@ -112,6 +113,7 @@
   this->current_vartype = none_vt;
   this->current_option  = none_opt;
   this->search_name = get_var_name_c::get_name(variable);
+  if (NULL == search_scope) ERROR;
   search_scope->accept(*this);
   return this->current_vartype;
 }
@@ -120,6 +122,7 @@
   this->current_vartype = none_vt;
   this->current_option  = none_opt;
   this->search_name = get_var_name_c::get_name(variable);
+  if (NULL == search_scope) ERROR;
   search_scope->accept(*this);
   return this->current_option;
 }