@@ -578,13 +578,14 @@ static long long check_shift_count(struct instruction *insn, unsigned long long
static int simplify_or_lsr(struct instruction *insn, pseudo_t src, pseudo_t other, unsigned shift)
{
// src->def->opcode == OP_AND
- pseudo_t src2 = src->def->src2;
+ struct instruction *insn2 = src->def;
+ pseudo_t src2 = insn2->src2;
if (!constant(src2))
return 0;
- if (((unsigned long long) src2->value) >> shift)
- return 0;
- return replace_pseudo(insn, &insn->src1, other);
+ if ((((unsigned long long)src2->value) >> shift) == 0)
+ return replace_pseudo(insn, &insn->src1, other);
+ return 0;
}
static int simplify_shift(struct instruction *insn, pseudo_t pseudo, long long value)
No functional changes, just moving the code around to prepare the next patch. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> --- simplify.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)