aboutsummaryrefslogtreecommitdiff
path: root/gdb/ada-lang.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2019-05-10 10:40:15 -0600
committerTom Tromey <tromey@adacore.com>2019-05-14 16:07:28 -0600
commitc408a94f8115767ea7e6aa1a75bc59ea5ae960fa (patch)
tree7fb8f6def4ac5c6ea165695d0a7c8f564c62d698 /gdb/ada-lang.c
parenta0a3a1e9d71887bbff54fcd1e33fcefcbc78b603 (diff)
downloadbinutils-c408a94f8115767ea7e6aa1a75bc59ea5ae960fa.zip
binutils-c408a94f8115767ea7e6aa1a75bc59ea5ae960fa.tar.gz
binutils-c408a94f8115767ea7e6aa1a75bc59ea5ae960fa.tar.bz2
Fix assertion failure in coerce_unspec_val_to_type
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.
Diffstat (limited to 'gdb/ada-lang.c')
-rw-r--r--gdb/ada-lang.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index dee3a83..23197f6 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -672,7 +672,8 @@ coerce_unspec_val_to_type (struct value *val, struct type *type)
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;
}
}