OSDN Git Service

* cpplib.c (do_define): Only free the old definition if it
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 14 Feb 2000 07:57:30 +0000 (07:57 +0000)
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 14 Feb 2000 07:57:30 +0000 (07:57 +0000)
actually had one.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@31964 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/cpplib.c

index 21b8fc4..0f0b435 100644 (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
index 9238d33..844b89f 100644 (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;
        }
     }