summaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>1999-09-12 06:30:39 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>1999-09-12 06:30:39 +0000
commitf65c28aba31572d73c80b5b2cdf791a1edf787a9 (patch)
tree88853ad115b0c3604e2de43f3c0a9c852fdb276a /gcc/tree.c
parent41843f13d6540ed412f8cd0f88676d1f2f7fc323 (diff)
downloadgcc-f65c28aba31572d73c80b5b2cdf791a1edf787a9.tar.gz
* tree.c (save_tree_status): Revert 10 Sep change.
(restore_tree_status): Likewise. Call obstack_free with NULL before freeing the obstack proper. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29355 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index b9da51bd5a5..ca471a92bc6 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -365,7 +365,8 @@ save_tree_status (p)
function_maybepermanent_obstack
= (struct obstack *) xmalloc (sizeof (struct obstack));
gcc_obstack_init (function_maybepermanent_obstack);
- maybepermanent_firstobj = NULL;
+ maybepermanent_firstobj
+ = (char *) obstack_finish (function_maybepermanent_obstack);
function_obstack = (struct obstack *) xmalloc (sizeof (struct obstack));
gcc_obstack_init (function_obstack);
@@ -394,14 +395,16 @@ restore_tree_status (p)
/* Free saveable storage used by the function just compiled and not
saved. */
obstack_free (function_maybepermanent_obstack, maybepermanent_firstobj);
+ if (obstack_empty_p (function_maybepermanent_obstack))
+ {
+ obstack_free (function_maybepermanent_obstack, NULL);
+ free (function_maybepermanent_obstack);
+ }
obstack_free (&temporary_obstack, temporary_firstobj);
obstack_free (&momentary_obstack, momentary_function_firstobj);
obstack_free (function_obstack, NULL);
-
- if (maybepermanent_firstobj == NULL)
- free (function_maybepermanent_obstack);
free (function_obstack);
temporary_firstobj = p->temporary_firstobj;