]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb] Fix prop->const_val uses in gdbtypes.c
authorTom de Vries <tdevries@suse.de>
Wed, 5 Aug 2020 10:31:58 +0000 (12:31 +0200)
committerTom de Vries <tdevries@suse.de>
Wed, 5 Aug 2020 10:31:58 +0000 (12:31 +0200)
After commit 66d6346b25 "gdb: remove TYPE_DYN_PROP_ADDR", I run into:
...
FAIL: gdb.fortran/class-allocatable-array.exp: print this%_data%b
...
(and 185 more FAILs, all for fortran test-cases).

The commit replaces "!x" by "x != 0".

Fix this by using "x == 0" instead.

Build and tested on x86_64-linux.

gdb/ChangeLog:

2020-08-05  Tom de Vries  <tdevries@suse.de>

* gdbtypes.c (type_not_allocated, type_not_associated): Use
"prop->const_val () == 0" instead of "prop->const_val () != 0".

gdb/ChangeLog
gdb/gdbtypes.c

index 2cd89b73b7d93e0b363d9669bb407c66f8ce763d..066512703ac82bc6ad61cc8e415af6dca5f9509c 100644 (file)
@@ -1,3 +1,8 @@
+2020-08-05  Tom de Vries  <tdevries@suse.de>
+
+       * gdbtypes.c (type_not_allocated, type_not_associated): Use
+       "prop->const_val () == 0" instead of "prop->const_val () != 0".
+
 2020-08-04  Simon Marchi  <simon.marchi@efficios.com>
 
        * frame.h (frame_id_p): Return bool.
index 0cd4b194d98276d66d8189a5f24494c703eb4613..da1c58c65c151c77a401a23d85f4e984d8a87a61 100644 (file)
@@ -4134,7 +4134,7 @@ type_not_allocated (const struct type *type)
   struct dynamic_prop *prop = TYPE_ALLOCATED_PROP (type);
 
   return (prop != nullptr && prop->kind () == PROP_CONST
-         && prop->const_val () != 0);
+         && prop->const_val () == 0);
 }
 
 /* Associated status of type TYPE.  Return zero if type TYPE is associated.
@@ -4146,7 +4146,7 @@ type_not_associated (const struct type *type)
   struct dynamic_prop *prop = TYPE_ASSOCIATED_PROP (type);
 
   return (prop != nullptr && prop->kind () == PROP_CONST
-         && prop->const_val () != 0);
+         && prop->const_val () == 0);
 }
 
 /* rank_one_type helper for when PARM's type code is TYPE_CODE_PTR.  */