memops.c: always true expression
PATCH 1/1 memops.c: always true expression
I noticed that the second part of this conditional is always true. Just a shot in the dark: Could that be a typo?
--- memops.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
memops.c +1 -1
@@ -69,7 +69,7 @@ static int address_taken(pseudo_t pseudo)struct pseudo_user *pu; FOR_EACH_PTR(pseudo->users, pu) {struct instruction *insn = pu->insn; -if (insn->bb && (insn->opcode !=OP_LOAD || insn->opcode !=OP_STORE )) +if (insn->bb && (insn->opcode !=OP_LOAD && insn->opcode !=OP_STORE ))return 1 ; }END_FOR_EACH_PTR (pu);return 0 ;
Signature · 1 line
1.7.2.2
Christopher Li
maintainerQuoted 4 lines · Nicolas Kaiser
I noticed that the second part of this conditional is always true.
Just a shot in the dark: Could that be a typo?
- if (insn->bb&& (insn->opcode!=OP_LOAD||insn->opcode!=OP_STORE))
+ if (insn->bb&& (insn->opcode!=OP_LOAD&&insn->opcode!=OP_STORE))
I think you are right. The insn->opcode can't be both OP_LOAD and OP_STORE.
The fix seems right to me. That is a good catch.
Thanks
Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 9 lines · Christopher Li
Quoted 4 lines · Nicolas Kaiser
I noticed that the second part of this conditional is always true.
Just a shot in the dark: Could that be a typo?
- if (insn->bb&& (insn->opcode!=OP_LOAD||insn->opcode!=OP_STORE))
+ if (insn->bb&& (insn->opcode!=OP_LOAD&&insn->opcode!=OP_STORE))I think you are right. The
insn->opcodecan't be bothOP_LOADandOP_STORE.The fix seems right to me. That is a good catch.
I wonder if running sparse on it could catch this...
Regards,
Signature · 5 lines
Anderson Lizardo -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html