aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/gdbtypes.c8
2 files changed, 9 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index b418b75..d8b3313 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2021-04-07 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * gdbtypes.c (types_equal): Move pointer equality check earlier in
+ the function.
+
2021-04-07 Caroline Tice <cmtice@google.com>
* dwarf2/read.c (try_open_dwop_file): Add path for the binary to
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 5a20e7e..84c4f34 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -4075,6 +4075,10 @@ types_equal (struct type *a, struct type *b)
if (b->code () == TYPE_CODE_TYPEDEF)
b = check_typedef (b);
+ /* Check if identical after resolving typedefs. */
+ if (a == b)
+ return true;
+
/* If after resolving typedefs a and b are not of the same type
code then they are not equal. */
if (a->code () != b->code ())
@@ -4097,10 +4101,6 @@ types_equal (struct type *a, struct type *b)
&& strcmp (a->name (), b->name ()) == 0)
return true;
- /* Check if identical after resolving typedefs. */
- if (a == b)
- return true;
-
/* Two function types are equal if their argument and return types
are equal. */
if (a->code () == TYPE_CODE_FUNC)