aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpplib.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@wolery.cumb.org>2000-05-19 16:18:43 +0000
committerZack Weinberg <zack@gcc.gnu.org>2000-05-19 16:18:43 +0000
commita58f64f5c2bbd1ebd8a22251f91c7835b2010f4b (patch)
tree0aad9c8e963144815de00592e7873a3ad3bb0aab /gcc/cpplib.c
parentec5bb3cfb0fa99afb261b589bb238e830d341e94 (diff)
downloadgcc-a58f64f5c2bbd1ebd8a22251f91c7835b2010f4b.zip
gcc-a58f64f5c2bbd1ebd8a22251f91c7835b2010f4b.tar.gz
gcc-a58f64f5c2bbd1ebd8a22251f91c7835b2010f4b.tar.bz2
cpplex.c (_cpp_scan_until): Clear AUX field of tokens.
* cpplex.c (_cpp_scan_until): Clear AUX field of tokens. * cpplib.c (do_unassert): Put the list to compare against on the stack. From-SVN: r34025
Diffstat (limited to 'gcc/cpplib.c')
-rw-r--r--gcc/cpplib.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/gcc/cpplib.c b/gcc/cpplib.c
index 23b522c..1679306 100644
--- a/gcc/cpplib.c
+++ b/gcc/cpplib.c
@@ -1607,8 +1607,9 @@ do_unassert (pfile)
U_CHAR *sym;
size_t len;
HASHNODE *hp;
- struct predicate *pred = 0;
+ cpp_toklist ans;
enum cpp_ttype type;
+ int specific = 0;
old_written = CPP_WRITTEN (pfile);
pfile->no_macro_expand++;
@@ -1624,10 +1625,10 @@ do_unassert (pfile)
type = _cpp_get_directive_token (pfile);
if (type == CPP_OPEN_PAREN)
{
- pred = (struct predicate *) xmalloc (sizeof (struct predicate));
- _cpp_init_toklist (&pred->answer);
+ specific = 1;
+ _cpp_init_toklist (&ans);
- if (_cpp_scan_until (pfile, &pred->answer, CPP_CLOSE_PAREN)
+ if (_cpp_scan_until (pfile, &ans, CPP_CLOSE_PAREN)
!= CPP_CLOSE_PAREN)
ERROR ("missing close paren in #unassert");
@@ -1645,13 +1646,13 @@ do_unassert (pfile)
goto error to clean up. */
goto error;
- if (pred)
+ if (specific)
{
/* Find this specific answer and remove it. */
struct predicate *o, *p;
for (p = NULL, o = hp->value.pred; o; p = o, o = o->next)
- if (_cpp_equiv_toklists (&pred->answer, &o->answer))
+ if (_cpp_equiv_toklists (&ans, &o->answer))
{
if (p)
p->next = o->next;
@@ -1682,11 +1683,8 @@ do_unassert (pfile)
_cpp_skip_rest_of_line (pfile);
pfile->no_macro_expand--;
CPP_SET_WRITTEN (pfile, old_written);
- if (pred)
- {
- _cpp_free_toklist (&pred->answer);
- free (pred);
- }
+ if (specific)
+ _cpp_free_toklist (&ans);
return 0;
}