coerce_unspec_val_to_type does:
set_value_address (result, value_address (val));
However, this is only valid for lval_memory. This patch changes this
code to only set the address for lval_memory values.
This seems like an ordinary oversight in coerce_unspec_val_to_type,
and a test case would be difficult to write, so I'm submitting it
without a test case.
Tested on x86-64 Fedora 29; plus using an Ada program that exhibits
the bug (but which cannot be shared).
gdb/ChangeLog
2019-05-14 Tom Tromey <tromey@adacore.com>
* ada-lang.c (coerce_unspec_val_to_type): Only set address when
value is not lval_memory.
+2019-05-14 Tom Tromey <tromey@adacore.com>
+
+ * ada-lang.c (coerce_unspec_val_to_type): Only set address when
+ value is not lval_memory.
+
2019-05-14 Tom Tromey <tromey@adacore.com>
* solib.c (info_sharedlibrary_command): Style the file name.
set_value_component_location (result, val);
set_value_bitsize (result, value_bitsize (val));
set_value_bitpos (result, value_bitpos (val));
- set_value_address (result, value_address (val));
+ if (VALUE_LVAL (result) == lval_memory)
+ set_value_address (result, value_address (val));
return result;
}
}