aboutsummaryrefslogtreecommitdiff
path: root/gdb/value.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-04-10 08:24:43 -0600
committerTom Tromey <tom@tromey.com>2018-05-25 13:53:09 -0600
commit41a883c8edf98e86176d007bc8ad1c86c9675528 (patch)
treeffeb4d84f6cdfc38dcd405976e3425af84b7276f /gdb/value.c
parentbf259e253f0d27323756fb434ba6e94d50846021 (diff)
downloadgdb-41a883c8edf98e86176d007bc8ad1c86c9675528.zip
gdb-41a883c8edf98e86176d007bc8ad1c86c9675528.tar.gz
gdb-41a883c8edf98e86176d007bc8ad1c86c9675528.tar.bz2
Clear entire "location" in value constructor
My recent change to allocate values with "new" may have introduced a small bug. In particular, the previous code allocated with XCNEW, but the new code only clears a part of the "location" field in the constructor. I didn't try very hard to actually trigger a bug here, the problem remains theoretical. This patch just arranges to initialize the entire location. Regression tested by the buildbot. 2018-05-25 Tom Tromey <tom@tromey.com> * value.c (value::location): Initialize.
Diffstat (limited to 'gdb/value.c')
-rw-r--r--gdb/value.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/gdb/value.c b/gdb/value.c
index aa6ca43..6bb6b8e 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -180,7 +180,6 @@ struct value
type (type_),
enclosing_type (type_)
{
- location.address = 0;
}
~value ()
@@ -262,7 +261,7 @@ struct value
/* Closure for those functions to use. */
void *closure;
} computed;
- } location;
+ } location {};
/* Describes offset of a value within lval of a structure in target
addressable memory units. Note also the member embedded_offset