aboutsummaryrefslogtreecommitdiff
path: root/gcc/cppmacro.c
diff options
context:
space:
mode:
authorNeil Booth <neilb@earthling.net>2000-08-17 18:01:43 +0000
committerNeil Booth <neil@gcc.gnu.org>2000-08-17 18:01:43 +0000
commit709e9e509cdca723aec76fb1076b2feb1264192b (patch)
tree08a55b2310020143695da9578d6843781f8dda0a /gcc/cppmacro.c
parente33f6253857ef2e87ad037c0452c09db7a940b8c (diff)
downloadgcc-709e9e509cdca723aec76fb1076b2feb1264192b.zip
gcc-709e9e509cdca723aec76fb1076b2feb1264192b.tar.gz
gcc-709e9e509cdca723aec76fb1076b2feb1264192b.tar.bz2
cppinit.c (cpp_cleanup): Free include dir chains.
* 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
Diffstat (limited to 'gcc/cppmacro.c')
-rw-r--r--gcc/cppmacro.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/cppmacro.c b/gcc/cppmacro.c
index ade67d7..3c9ffb9 100644
--- a/gcc/cppmacro.c
+++ b/gcc/cppmacro.c
@@ -404,6 +404,18 @@ _cpp_free_definition (h)
{
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;
}