Remove potential access to NULL pointer.
authorMario de Sousa <msousa@fe.up.pt>
Wed, 18 Apr 2012 15:44:00 +0100
changeset 523 773303b7f31f
parent 522 f9cff11ae622
child 524 52b18b3c7490
Remove potential access to NULL pointer.
stage3/fill_candidate_datatypes.cc
--- a/stage3/fill_candidate_datatypes.cc	Wed Apr 18 13:29:08 2012 +0100
+++ b/stage3/fill_candidate_datatypes.cc	Wed Apr 18 15:44:00 2012 +0100
@@ -689,8 +689,10 @@
 void *fill_candidate_datatypes_c::visit(located_var_decl_c *symbol) {
   symbol->located_var_spec_init->accept(*this);
   symbol->location->accept(*this);
-  symbol->variable_name->candidate_datatypes = symbol->location->candidate_datatypes;
-  intersect_candidate_datatype_list(symbol->variable_name /*origin, dest.*/, symbol->located_var_spec_init /*with*/);
+  if (NULL != symbol->variable_name) {
+    symbol->variable_name->candidate_datatypes = symbol->location->candidate_datatypes;
+    intersect_candidate_datatype_list(symbol->variable_name /*origin, dest.*/, symbol->located_var_spec_init /*with*/);
+  }
   return NULL;
 }