diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2017-06-01 03:54:57 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-07-23 01:40:31 +0200 |
| commit | d4920a58d9e84138b51804fb194fc3b3936a5030 (patch) | |
| tree | f934c02b12500740b2986cc77f7ce8a6e21aaeaa | |
| parent | bfe532a4f10f480085aac3a5785de3cca90e7ee5 (diff) | |
| download | sparse-dev-d4920a58d9e84138b51804fb194fc3b3936a5030.tar.gz | |
big-shift: reorder the tests in simplify_asr()
This is in preparation of some incoming changes here.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
| -rw-r--r-- | simplify.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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; } |
