gengtype-state.c (read_a_state_token): Fix argument to obstack_free.
authorDimitrios Apostolou <jimis@gmx.net>
Thu, 21 Apr 2011 14:53:43 +0000 (14:53 +0000)
committerJeff Law <law@gcc.gnu.org>
Thu, 21 Apr 2011 14:53:43 +0000 (08:53 -0600)
* gengtype-state.c (read_a_state_token): Fix argument to
obstack_free.
* gengtype.c (matching_file_name_substitute): Likewise.

Co-Authored-By: Jeff Law <law@redhat.com>
From-SVN: r172832

gcc/ChangeLog
gcc/gengtype-state.c
gcc/gengtype.c

index 3ed9e91cab198cd26573d4c99063ad4a7b4f7709..954e58d8f836b26ff84fc7b18521e60b54b81ff8 100644 (file)
@@ -1,3 +1,10 @@
+2011-04-21  Dimitrios Apostolou  <jimis@gmx.net>
+           Jeff Law  <law@redhat.com>
+
+       * gengtype-state.c (read_a_state_token): Fix argument to 
+       obstack_free.
+       * gengtype.c (matching_file_name_substitute): Likewise.
+
 2011-04-21  Richard Guenther  <rguenther@suse.de>
 
        PR lto/48703
index fbfb35a54b263c77a9cb910da3de164599091255..e9aa5d2ed8571be9df4e09fcb9e04925d75a973a 100644 (file)
@@ -303,7 +303,7 @@ read_a_state_token (void)
       obstack_1grow (&id_obstack, (char) 0);
       ids = XOBFINISH (&id_obstack, char *);
       sid = state_ident_by_name (ids, INSERT);
-      obstack_free (&id_obstack, ids);
+      obstack_free (&id_obstack, NULL);
       ids = NULL;
       tk = XCNEW (struct state_token_st);
       tk->stok_kind = STOK_NAME;
@@ -408,7 +408,7 @@ read_a_state_token (void)
       tk->stok_file = state_path;
       tk->stok_next = NULL;
       strcpy (tk->stok_un.stok_string, cstr);
-      obstack_free (&bstring_obstack, cstr);
+      obstack_free (&bstring_obstack, NULL);
 
       return tk;
     }
index cb0c77b241d72f2d2e71876055dd89f8857a0adb..5dd877e594218e8b650c012d974c242820c25169 100644 (file)
@@ -1943,7 +1943,7 @@ matching_file_name_substitute (const char *filnam, regmatch_t pmatch[10],
   obstack_1grow (&str_obstack, '\0');
   rawstr = XOBFINISH (&str_obstack, char *);
   str = xstrdup (rawstr);
-  obstack_free (&str_obstack, rawstr);
+  obstack_free (&str_obstack, NULL);
   DBGPRINTF ("matched replacement %s", str);
   rawstr = NULL;
   return str;