This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] Probable boolean logic error
- From: Michael McConville <mmcco at mykolab dot com>
- To: gdb-patches at sourceware dot org
- Date: Tue, 5 Dec 2017 00:35:02 -0700
- Subject: [PATCH] Probable boolean logic error
- Authentication-results: sourceware.org; auth=none
Unless I’m misunderstanding, these two conditions reduce to “if (true)” in their current form.
The most likely explanation is that someone mistakenly typed the wrong boolean operator.
2017-12-04 Michael McConville <mmcco@mykolab.com>
* mips-linux-tdep.c (mips_linux_in_dynsym_stub): fix boolean typo in two conditions
diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c
index ebdacd981e..6c236e14a1 100644
--- a/gdb/mips-linux-tdep.c
+++ b/gdb/mips-linux-tdep.c
@@ -709,15 +709,15 @@ mips_linux_in_dynsym_stub (CORE_ADDR pc)
insn = extract_unsigned_integer (p + 4, 4, byte_order);
if (n64)
{
- /* 'daddu t7,ra' or 'or t7, ra, zero'*/
- if (insn != 0x03e0782d || insn != 0x03e07825)
+ /* 'daddu t7,ra' and 'or t7, ra, zero'*/
+ if (insn != 0x03e0782d && insn != 0x03e07825)
return 0;
}
else
{
- /* 'addu t7,ra' or 'or t7, ra, zero'*/
- if (insn != 0x03e07821 || insn != 0x03e07825)
+ /* 'addu t7,ra' and 'or t7, ra, zero'*/
+ if (insn != 0x03e07821 && insn != 0x03e07825)
return 0;
}