Fix bug: set the scope annotation in deref_operators used inside structs
authormjsousa
Sat, 25 Oct 2014 13:17:12 +0100
changeset 942 8739d8259932
parent 941 c2ef93412407
child 943 566414d7ba1f
Fix bug: set the scope annotation in deref_operators used inside structs
stage3/fill_candidate_datatypes.cc
--- a/stage3/fill_candidate_datatypes.cc	Sat Oct 25 11:28:48 2014 +0100
+++ b/stage3/fill_candidate_datatypes.cc	Sat Oct 25 13:17:12 2014 +0100
@@ -1966,6 +1966,9 @@
   if (symbol->candidate_datatypes.size() == 1)
     // narrow the symbol->datatype for this symbol as explained above!
     symbol->datatype = symbol->candidate_datatypes[0];
+
+  /*        Since the deref_operator_c may be used inside structures, we must handle set the 'scope' annotation here too! */
+  symbol->scope = symbol->exp->scope;
   
   return NULL;
 }