cpplib.c (do_define): Only free the old definition if it actually had one.

* cpplib.c (do_define): Only free the old definition if it
	actually had one.

From-SVN: r31964
This commit is contained in:
Zack Weinberg 2000-02-14 07:57:30 +00:00 committed by Zack Weinberg
parent 67b8719a74
commit f9ba428f57
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2000-02-13 Zack Weinberg <zack@wolery.cumb.org>
* cpplib.c (do_define): Only free the old definition if it
actually had one.
2000-02-13 Neil Booth <NeilB@earthling.net>
* cppfiles.c (read_and_prescan): When emitting deferred

View File

@ -715,8 +715,9 @@ do_define (pfile, keyword)
if (hp->type != T_POISON)
{
/* Replace the old definition. */
if (hp->type == T_MACRO)
free_definition (hp->value.defn);
hp->type = T_MACRO;
free_definition (hp->value.defn);
hp->value.defn = mdef.defn;
}
}