[PATCH 09/17] big-shift: reorder the tests in simplify_asr()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is in preparation of some incoming changes here.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 simplify.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/simplify.c b/simplify.c
index d316367d8..fc148124f 100644
--- a/simplify.c
+++ b/simplify.c
@@ -542,14 +542,16 @@ undef:
 
 static int simplify_asr(struct instruction *insn, pseudo_t pseudo, long long value)
 {
-	unsigned int size = operand_size(insn, pseudo);
+	unsigned int size;
 
+	if (!value)
+		return replace_with_pseudo(insn, pseudo);
+
+	size = operand_size(insn, pseudo);
 	if (value >= size && !insn->tainted) {
 		warning(insn->pos, "right shift by bigger than source value");
 		insn->tainted = 1;
 	}
-	if (!value)
-		return replace_with_pseudo(insn, pseudo);
 	return 0;
 }
 
-- 
2.18.0

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux