mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-05-31 01:45:52 +08:00
Use new_reference for struct value
value_incref returned its argument just as a convenience, which in the end turned out to only be used in precisely the cases where new_reference helps. So, this patch changes value_incref to return void and changes some value-using code to use new_reference. I also noticed that the comments for value_incref and value_decref were swapped, so this patch fixes those. ChangeLog 2018-04-30 Tom Tromey <tom@tromey.com> * varobj.c (install_new_value): Use new_reference. * value.h (value_incref): Return void. Swap intro comment with value_decref. * value.c (set_value_parent): Use new_reference. (value_incref): Return void. Update intro comment. (release_value): Use new_reference. * dwarf2loc.c (dwarf2_evaluate_loc_desc_full): Use new_reference.
This commit is contained in:
@ -1329,7 +1329,7 @@ install_new_value (struct varobj *var, struct value *value, bool initial)
|
||||
code that might release it. */
|
||||
value_ref_ptr value_holder;
|
||||
if (value != NULL)
|
||||
value_holder.reset (value_incref (value));
|
||||
value_holder = value_ref_ptr::new_reference (value);
|
||||
|
||||
/* Below, we'll be comparing string rendering of old and new
|
||||
values. Don't get string rendering if the value is
|
||||
|
Reference in New Issue
Block a user