diff options
| author | Aymeric Vincent <aymeric.vincent@cea.fr> | 2018-03-02 13:39:49 +0100 |
|---|---|---|
| committer | Aymeric Vincent <aymeric.vincent@cea.fr> | 2018-03-02 13:40:06 +0100 |
| commit | 88d495e26474935cb656e2d84747b37568baa9a3 (patch) | |
| tree | d09df6e2e33e9dfe096c2801fc160e1b444cfbc5 | |
| parent | 00e567eacd167047de5b088a94f554473e7ca505 (diff) | |
| download | miasm-88d495e26474935cb656e2d84747b37568baa9a3.tar.gz miasm-88d495e26474935cb656e2d84747b37568baa9a3.zip | |
Fix semantics of conditional jumps
Spotted by @serpilliere
Diffstat (limited to '')
| -rw-r--r-- | miasm2/arch/ppc/sem.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/miasm2/arch/ppc/sem.py b/miasm2/arch/ppc/sem.py index 76a1a27e..3c9d0e83 100644 --- a/miasm2/arch/ppc/sem.py +++ b/miasm2/arch/ppc/sem.py @@ -704,11 +704,11 @@ def mn_do_cond_branch(ir, instr, dest): bo = instr.additional_info.bo bi = instr.additional_info.bi ret = [] - if not (bo & 0b00100): - ret.append(ExprAff(CTR, CTR - ExprInt(1, 32))) - if (bo & 0b10100) == 0b10100: + + if bo & 0b00100: ctr_cond = True else: + ret.append(ExprAff(CTR, CTR - ExprInt(1, 32))) ctr_cond = ExprCond(CTR ^ ExprInt(1, 32), ExprInt(1, 1), ExprInt(0, 1)) if bo & 0b00010: ctr_cond = ~ctr_cond |