diff options
| author | Camille Mougey <commial@gmail.com> | 2018-06-09 09:05:05 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-06-09 09:05:05 +0200 |
| commit | 990060f21e515ff1a25246f8fdf0936a97ac698f (patch) | |
| tree | b10543391f9a66ddd5e3f6852c30d96b169b623d /miasm2/arch/mips32/jit.py | |
| parent | dadfaabc3fff5edb9bf4ef7e7e8c4cfc4baccb94 (diff) | |
| parent | 61551fa78e9dd22ed1f982b4fe171fd6383c39a6 (diff) | |
| download | miasm-990060f21e515ff1a25246f8fdf0936a97ac698f.tar.gz miasm-990060f21e515ff1a25246f8fdf0936a97ac698f.zip | |
Merge pull request #751 from serpilliere/ExprLabel
Expr Loc
Diffstat (limited to 'miasm2/arch/mips32/jit.py')
| -rw-r--r-- | miasm2/arch/mips32/jit.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/miasm2/arch/mips32/jit.py b/miasm2/arch/mips32/jit.py index 16d88067..180f8b0a 100644 --- a/miasm2/arch/mips32/jit.py +++ b/miasm2/arch/mips32/jit.py @@ -57,10 +57,10 @@ class mipsCGen(CGen): self.ir_arch.pc] assignments[self.delay_slot_set] = m2_expr.ExprInt(1, 32) # Replace IRDst with next instruction - assignments[self.ir_arch.IRDst] = m2_expr.ExprId( - self.ir_arch.get_next_instr(assignblock.instr), 32) + dst_loc_key = self.ir_arch.get_next_instr(assignblock.instr) + assignments[self.ir_arch.IRDst] = m2_expr.ExprLoc(dst_loc_key, 32) irs.append(AssignBlock(assignments, assignblock.instr)) - irblocks[blk_idx] = IRBlock(irblock.label, irs) + irblocks[blk_idx] = IRBlock(irblock.loc_key, irs) return irblocks_list @@ -69,12 +69,13 @@ class mipsCGen(CGen): Generate the C code for the final block instruction """ - lbl = self.get_block_post_label(block) - out = (self.CODE_RETURN_NO_EXCEPTION % (self.label_to_jitlabel(lbl), + loc_key = self.get_block_post_label(block) + offset = self.ir_arch.symbol_pool.loc_key_to_offset(loc_key) + out = (self.CODE_RETURN_NO_EXCEPTION % (self.loc_key_to_jitlabel(loc_key), self.C_PC, m2_expr.ExprId('branch_dst_irdst', 32), m2_expr.ExprId('branch_dst_irdst', 32), - self.id_to_c(m2_expr.ExprInt(lbl.offset, 32))) + self.id_to_c(m2_expr.ExprInt(offset, 32))) ).split('\n') return out |