diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2018-05-18 14:43:57 +0200 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2018-06-09 00:33:48 +0200 |
| commit | 61551fa78e9dd22ed1f982b4fe171fd6383c39a6 (patch) | |
| tree | b10543391f9a66ddd5e3f6852c30d96b169b623d /test/core/sembuilder.py | |
| parent | a2637cdf0b40df074865d23a7fd71f082ad7f40a (diff) | |
| download | miasm-61551fa78e9dd22ed1f982b4fe171fd6383c39a6.tar.gz miasm-61551fa78e9dd22ed1f982b4fe171fd6383c39a6.zip | |
Core: replace AsmLabel by LocKey
Diffstat (limited to 'test/core/sembuilder.py')
| -rw-r--r-- | test/core/sembuilder.py | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/test/core/sembuilder.py b/test/core/sembuilder.py index f3894927..53aa199d 100644 --- a/test/core/sembuilder.py +++ b/test/core/sembuilder.py @@ -2,22 +2,23 @@ import inspect from pdb import pm from miasm2.core.sembuilder import SemBuilder +from miasm2.core.asmblock import AsmSymbolPool import miasm2.expression.expression as m2_expr -from miasm2.core.asmblock import AsmLabel + + # Test classes class IR(object): + def __init__(self, symbol_pool): + self.symbol_pool = symbol_pool IRDst = m2_expr.ExprId("IRDst", 32) def get_next_instr(self, _): - return AsmLabel(m2_expr.LocKey(0), "NEXT") - - def get_next_label(self, _): - return AsmLabel(m2_expr.LocKey(0), "NEXT") + return m2_expr.LocKey(0) - def gen_label(self): - return AsmLabel(m2_expr.LocKey(1), "GEN") + def get_next_loc_key(self, _): + return m2_expr.LocKey(0) class Instr(object): mode = 32 @@ -44,7 +45,8 @@ def test(Arg1, Arg2, Arg3): a = m2_expr.ExprId('A', 32) b = m2_expr.ExprId('B', 32) c = m2_expr.ExprId('C', 32) -ir = IR() +symbol_pool = AsmSymbolPool() +ir = IR(symbol_pool) instr = Instr() res = test(ir, instr, a, b, c) @@ -58,7 +60,7 @@ for statement in res[0]: print "[+] Blocks:" for irb in res[1]: - print irb.label + print irb.loc_key for assignblk in irb: for expr in assignblk: print expr |