summaryrefslogtreecommitdiff
path: root/gdb/cp-valprint.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@debian.org>2007-02-08 14:20:56 +0000
committerDaniel Jacobowitz <dan@debian.org>2007-02-08 14:20:56 +0000
commit8a6ec4761fe805f386b5ce8a03f1bbc20ac116c8 (patch)
tree3ec37f04e8d9fbc9b49c5ec6202a3f6a82a0200e /gdb/cp-valprint.c
parent75c2851d4af2e37631d3e20cf2ac4c82be945104 (diff)
downloadgdb-8a6ec4761fe805f386b5ce8a03f1bbc20ac116c8.tar.gz
* 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.
Diffstat (limited to 'gdb/cp-valprint.c')
-rw-r--r--gdb/cp-valprint.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c
index b69ab2240eb..49f05609529 100644
--- a/gdb/cp-valprint.c
+++ b/gdb/cp-valprint.c
@@ -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);
}