* cppinit.c (cpp_cleanup): Free include dir chains.
* cpplib.c (do_undef): Let _cpp_free_definition make the node void.
(do_unassert): Free the assert with _cpp_free_definition.
* cppmacro.c (_cpp_free_definition): Free memory allocated for
assertions. Make the node a T_VOID node.
From-SVN: r35765
+2000-08-17 Neil Booth <NeilB@earthling.net>
+
+ * cppinit.c (cpp_cleanup): Free include dir chains.
+ * cpplib.c (do_undef): Let _cpp_free_definition make the node void.
+ (do_unassert): Free the assert with _cpp_free_definition.
+ * cppmacro.c (_cpp_free_definition): Free memory allocated for
+ assertions. Make the node a T_VOID node.
+
2000-08-17 Neil Booth <NeilB@earthling.net>
* cppinit.c (path_include, append_include_chain):
cpp_cleanup (pfile)
cpp_reader *pfile;
{
+ struct file_name_list *dir, *next;
+
while (CPP_BUFFER (pfile) != NULL)
cpp_pop_buffer (pfile);
_cpp_cleanup_includes (pfile);
_cpp_cleanup_stacks (pfile);
_cpp_cleanup_macros (pfile);
+
+ for (dir = CPP_OPTION (pfile, quote_include); dir; dir = next)
+ {
+ next = dir->next;
+ free (dir->name);
+ free (dir);
+ }
}
cpp_warning (pfile, "undefining \"%s\"", node->name);
_cpp_free_definition (node);
- node->type = T_VOID;
}
}
node->type = T_VOID;
}
else
- {
- for (temp = node->value.answers; temp; temp = next)
- {
- next = temp->next;
- FREE_ANSWER (temp);
- }
- node->type = T_VOID;
- }
+ _cpp_free_definition (node);
}
if (answer)
{
if (h->type == T_MACRO)
free ((PTR) h->value.expansion);
+ else if (h->type == T_ASSERTION)
+ {
+ struct answer *temp, *next;
+
+ for (temp = h->value.answers; temp; temp = next)
+ {
+ next = temp->next;
+ FREE_ANSWER (temp);
+ }
+ }
+
+ h->type = T_VOID;
h->value.expansion = NULL;
}