aboutsummaryrefslogtreecommitdiff
path: root/gdb/value.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2023-05-24 13:59:58 -0600
committerTom Tromey <tromey@adacore.com>2023-06-09 07:42:44 -0600
commit894592027535633de9438a8ff1e62d48a64767b6 (patch)
treefa891178476351c3698bf15549f2e441f5657150 /gdb/value.c
parent30711c89cc7dcd2bd4ea772b2f5dc639c5b1cfcc (diff)
downloadgdb-894592027535633de9438a8ff1e62d48a64767b6.zip
gdb-894592027535633de9438a8ff1e62d48a64767b6.tar.gz
gdb-894592027535633de9438a8ff1e62d48a64767b6.tar.bz2
Use scoped_value_mark in two more places
I found a couple of spots that could use scoped_value_mark. One of them is a spot that didn't consider the possibility that value_mark can return NULL. I tend to doubt this can be seen in this context, but nevertheless this is safer. Regression tested on x86-64 Fedora 36.
Diffstat (limited to 'gdb/value.c')
-rw-r--r--gdb/value.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/gdb/value.c b/gdb/value.c
index 9517868..1b31f91 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -3879,7 +3879,9 @@ value::fetch_lazy_register ()
frame_info_ptr next_frame;
int regnum;
struct type *type = check_typedef (this->type ());
- struct value *new_val = this, *mark = value_mark ();
+ struct value *new_val = this;
+
+ scoped_value_mark mark;
/* Offsets are not supported here; lazy register values must
refer to the entire register. */
@@ -3983,10 +3985,6 @@ value::fetch_lazy_register ()
frame_debug_printf ("%s", debug_file.c_str ());
}
-
- /* Dispose of the intermediate values. This prevents
- watchpoints from trying to watch the saved frame pointer. */
- value_free_to_mark (mark);
}
/* See value.h. */