From: Tom Tromey Date: Tue, 10 Apr 2018 14:24:43 +0000 (-0600) Subject: Clear entire "location" in value constructor X-Git-Tag: binutils-2_31~331 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=41a883c8edf98e86176d007bc8ad1c86c9675528;p=thirdparty%2Fbinutils-gdb.git 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 * value.c (value::location): Initialize. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 4f087b1e196..33c6a712a86 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2018-05-25 Tom Tromey + + * value.c (value::location): Initialize. + 2018-05-25 Tom Tromey * dbxread.c (init_bincl_list): Remove. diff --git a/gdb/value.c b/gdb/value.c index aa6ca43b414..6bb6b8eb61e 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