diff -r bc90dd4bbf4f -r f86d5d6bb04e stage3/constant_folding.cc --- a/stage3/constant_folding.cc Fri Dec 26 10:09:27 2014 +0000 +++ b/stage3/constant_folding.cc Fri Dec 26 12:43:13 2014 +0000 @@ -1390,10 +1390,12 @@ // SYM_REF4(resource_declaration_c, resource_name, resource_type_name, global_var_declarations, resource_declaration, // enumvalue_symtable_t enumvalue_symtable; localvar_symbmap_t localvar_symbmap; localvar_symbvec_t localvar_symbvec;) void *constant_folding_c::visit(resource_declaration_c *symbol) { - values.clear(); /* Clear global map */ + values.push(); /* Create inner scope */ /* Add initial value of all declared variables into Values map. */ function_pou_ = false; - return iterator_visitor_c::visit(symbol); // let the base iterator class handle the rest (basically iterate through the whole configuration and do the constant folding! + iterator_visitor_c::visit(symbol); // let the base iterator class handle the rest (basically iterate through the whole configuration and do the constant folding! + values.pop(); /* Delete inner scope */ + return NULL; }