diff options
Diffstat (limited to 'gdb/value.c')
-rw-r--r-- | gdb/value.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gdb/value.c b/gdb/value.c index 4e8d1fe..27043ee 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -1659,7 +1659,11 @@ record_latest_value (struct value *val) from. This is a bit dubious, because then *&$1 does not just return $1 but the current contents of that location. c'est la vie... */ val->modifiable = 0; - release_value (val); + + /* The value may have already been released, in which case we're adding a + new reference for its entry in the history. That is why we call + release_value_or_incref here instead of release_value. */ + release_value_or_incref (val); /* Here we treat value_history_count as origin-zero and applying to the value being stored now. */ |