diff -Naur SRC_old/parse_making_ast.c SRC/parse_making_ast.c --- SRC_old/parse_making_ast.c 2013-08-02 21:46:59.053272167 -0400 +++ SRC/parse_making_ast.c 2013-10-11 13:10:53.522662992 -0400 @@ -39,7 +39,7 @@ extern int yylineno; -STRING_CACHE *defines_for_file_sc; +STRING_CACHE *defines_for_file_sc = NULL; STRING_CACHE **defines_for_module_sc; STRING_CACHE *modules_inputs_sc; STRING_CACHE *modules_outputs_sc; @@ -221,7 +221,9 @@ *-------------------------------------------------------------------------------------------*/ void init_parser() { - defines_for_file_sc = sc_new_string_cache(); + if (defines_for_file_sc == NULL) { + defines_for_file_sc = sc_new_string_cache(); + } defines_for_module_sc = NULL; @@ -265,7 +267,9 @@ { /* crrate a hash for defines so we can look them up when we find them */ defines_for_module_sc = (STRING_CACHE**)realloc(defines_for_module_sc, sizeof(STRING_CACHE*)*(num_modules+1)); - defines_for_module_sc[num_modules] = sc_new_string_cache(); + // if (defines_for_module_sc[num_modules] == NULL) + if (num_modules == 0) + defines_for_module_sc[num_modules] = sc_new_string_cache(); /* create string caches to hookup PORTS with INPUT and OUTPUTs. This is made per module and will be cleaned and remade at next_module */ modules_inputs_sc = sc_new_string_cache(); @@ -279,6 +283,7 @@ { /* cleanup the defines hash */ sc_free_string_cache(defines_for_file_sc); + defines_for_file_sc = NULL; } /*---------------------------------------------------------------------------------------------