diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2017-12-11 14:26:23 +0100 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2018-06-08 17:35:05 +0200 |
| commit | a2637cdf0b40df074865d23a7fd71f082ad7f40a (patch) | |
| tree | f6c958ca8481e6e29760078e5d1bdc2d2b64da53 /miasm2/arch/ppc/sem.py | |
| parent | dadfaabc3fff5edb9bf4ef7e7e8c4cfc4baccb94 (diff) | |
| download | miasm-a2637cdf0b40df074865d23a7fd71f082ad7f40a.tar.gz miasm-a2637cdf0b40df074865d23a7fd71f082ad7f40a.zip | |
Expr: Add new word ExprLoc
This word represents a location in the binary. Thus, the hack of ExprId containing an AsmLabel ends here.
Diffstat (limited to 'miasm2/arch/ppc/sem.py')
| -rw-r--r-- | miasm2/arch/ppc/sem.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/miasm2/arch/ppc/sem.py b/miasm2/arch/ppc/sem.py index 741ae24b..775e24d3 100644 --- a/miasm2/arch/ppc/sem.py +++ b/miasm2/arch/ppc/sem.py @@ -690,7 +690,8 @@ def mn_b(ir, instr, arg1, arg2 = None): def mn_bl(ir, instr, arg1, arg2 = None): if arg2 is not None: arg1 = arg2 - return [ ExprAff(LR, ExprId(ir.get_next_instr(instr), 32)), + dst = ir.get_next_instr(instr) + return [ ExprAff(LR, ExprLoc(dst.loc_key, 32)), ExprAff(PC, arg1), ExprAff(ir.IRDst, arg1) ], [] @@ -726,13 +727,15 @@ def mn_do_cond_branch(ir, instr, dest): condition = condition & cond_cond else: condition = cond_cond + dst = ir.get_next_instr(instr) dest_expr = ExprCond(condition, dest, - ExprId(ir.get_next_instr(instr), 32)) + ExprLoc(dst.loc_key, 32)) else: dest_expr = dest if instr.name[-1] == 'L' or instr.name[-2:-1] == 'LA': - ret.append(ExprAff(LR, ExprId(ir.get_next_instr(instr), 32))) + dst = ir.get_next_instr(instr) + ret.append(ExprAff(LR, ExprLoc(dst.loc_key, 32))) ret.append(ExprAff(PC, dest_expr)) ret.append(ExprAff(ir.IRDst, dest_expr)) |