forked from Imagelibrary/binutils-gdb
Remove make_cleanup_value_free
This removes make_cleanup_value_free, in favor of a unique_ptr specialization. Regression tested by the buildbot. gdb/ChangeLog 2017-10-08 Tom Tromey <tom@tromey.com> * utils.h (make_cleanup_value_free): Remove. * utils.c (do_value_free, struct cleanup): Remove. * dwarf2loc.c (dwarf2_evaluate_loc_desc_full) <DWARF_VALUE_STACK>: Use gdb_value_up. * value.h (struct value_deleter): New. (gdb_value_up): New typedef.
This commit is contained in:
@@ -2478,7 +2478,6 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
|
||||
size_t len = TYPE_LENGTH (subobj_type);
|
||||
size_t max = TYPE_LENGTH (type);
|
||||
struct gdbarch *objfile_gdbarch = get_objfile_arch (objfile);
|
||||
struct cleanup *cleanup;
|
||||
|
||||
if (subobj_byte_offset + len > max)
|
||||
invalid_synthetic_pointer ();
|
||||
@@ -2488,7 +2487,7 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
|
||||
below. */
|
||||
value_incref (value);
|
||||
free_values.free_to_mark ();
|
||||
cleanup = make_cleanup_value_free (value);
|
||||
gdb_value_up value_holder (value);
|
||||
|
||||
retval = allocate_value (subobj_type);
|
||||
|
||||
@@ -2498,8 +2497,6 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
|
||||
|
||||
memcpy (value_contents_raw (retval),
|
||||
value_contents_all (value) + subobj_byte_offset, len);
|
||||
|
||||
do_cleanups (cleanup);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user