* cp-valprint.c (cp_print_value_fields, cp_print_value): Always
authorDaniel Jacobowitz <drow@false.org>
Thu, 8 Feb 2007 14:20:56 +0000 (14:20 +0000)
committerDaniel Jacobowitz <drow@false.org>
Thu, 8 Feb 2007 14:20:56 +0000 (14:20 +0000)
initialize tmp_obstack.
* p-valprint.c (pascal_object_print_value_fields)
(pascal_object_print_value): Likewise.

gdb/ChangeLog
gdb/cp-valprint.c
gdb/p-valprint.c

index 2759f070d70571138c7770eb978d8faad7bbe82a..a2fe880051abcaaa86404117a978c546d3c4386d 100644 (file)
@@ -1,3 +1,11 @@
+2007-02-08  Mark Kettenis  <kettenis@gnu.org>
+           Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * cp-valprint.c (cp_print_value_fields, cp_print_value): Always
+       initialize tmp_obstack.
+       * p-valprint.c (pascal_object_print_value_fields)
+       (pascal_object_print_value): Likewise.
+
 2007-02-08  Daniel Jacobowitz  <dan@codesourcery.com>
 
        * features/feature_to_c.sh: Use %s to avoid problems with nawk.
index b69ab2240eb386332db1481245f253727ff74a72..49f05609529499170b90258df1649ee7463870f9 100644 (file)
@@ -167,7 +167,6 @@ cp_print_value_fields (struct type *type, struct type *real_type,
                       struct type **dont_print_vb,int dont_print_statmem)
 {
   int i, len, n_baseclasses;
-  struct obstack tmp_obstack;
   char *last_dont_print = obstack_next_free (&dont_print_statmem_obstack);
   int fields_seen = 0;
 
@@ -197,12 +196,13 @@ cp_print_value_fields (struct type *type, struct type *real_type,
     fprintf_filtered (stream, "<No data fields>");
   else
     {
+      struct obstack tmp_obstack = dont_print_statmem_obstack;
+
       if (dont_print_statmem == 0)
        {
          /* If we're at top level, carve out a completely fresh
             chunk of the obstack and use that until this particular
             invocation returns.  */
-         tmp_obstack = dont_print_statmem_obstack;
          obstack_finish (&dont_print_statmem_obstack);
        }
 
@@ -426,9 +426,9 @@ cp_print_value (struct type *type, struct type *real_type,
                struct ui_file *stream, int format, int recurse,
                enum val_prettyprint pretty, struct type **dont_print_vb)
 {
-  struct obstack tmp_obstack;
   struct type **last_dont_print
     = (struct type **) obstack_next_free (&dont_print_vb_obstack);
+  struct obstack tmp_obstack = dont_print_vb_obstack;
   int i, n_baseclasses = TYPE_N_BASECLASSES (type);
   int thisoffset;
   struct type *thistype;
@@ -438,7 +438,6 @@ cp_print_value (struct type *type, struct type *real_type,
       /* If we're at top level, carve out a completely fresh
          chunk of the obstack and use that until this particular
          invocation returns.  */
-      tmp_obstack = dont_print_vb_obstack;
       /* Bump up the high-water mark.  Now alpha is omega.  */
       obstack_finish (&dont_print_vb_obstack);
     }
index 19556a4bcce213c7e7e6a0548d4ece6776d70b98..a383371ec3c63a1a23d27bb15687e7379b33f1e2 100644 (file)
@@ -641,7 +641,6 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr,
                                  int dont_print_statmem)
 {
   int i, len, n_baseclasses;
-  struct obstack tmp_obstack;
   char *last_dont_print = obstack_next_free (&dont_print_statmem_obstack);
 
   CHECK_TYPEDEF (type);
@@ -660,6 +659,7 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr,
     fprintf_filtered (stream, "<No data fields>");
   else
     {
+      struct obstack tmp_obstack = dont_print_statmem_obstack;
       int fields_seen = 0;
 
       if (dont_print_statmem == 0)
@@ -667,7 +667,6 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr,
          /* If we're at top level, carve out a completely fresh
             chunk of the obstack and use that until this particular
             invocation returns.  */
-         tmp_obstack = dont_print_statmem_obstack;
          obstack_finish (&dont_print_statmem_obstack);
        }
 
@@ -810,9 +809,9 @@ pascal_object_print_value (struct type *type, const gdb_byte *valaddr,
                           enum val_prettyprint pretty,
                           struct type **dont_print_vb)
 {
-  struct obstack tmp_obstack;
   struct type **last_dont_print
   = (struct type **) obstack_next_free (&dont_print_vb_obstack);
+  struct obstack tmp_obstack = dont_print_vb_obstack;
   int i, n_baseclasses = TYPE_N_BASECLASSES (type);
 
   if (dont_print_vb == 0)
@@ -820,7 +819,6 @@ pascal_object_print_value (struct type *type, const gdb_byte *valaddr,
       /* If we're at top level, carve out a completely fresh
          chunk of the obstack and use that until this particular
          invocation returns.  */
-      tmp_obstack = dont_print_vb_obstack;
       /* Bump up the high-water mark.  Now alpha is omega.  */
       obstack_finish (&dont_print_vb_obstack);
     }
This page took 0.030525 seconds and 4 git commands to generate.