about summary refs log tree commit diff stats
path: root/miasm2/jitter
diff options
context:
space:
mode:
authorCamille Mougey <commial@gmail.com>2018-08-29 16:27:06 +0200
committerGitHub <noreply@github.com>2018-08-29 16:27:06 +0200
commit7c0d412120abbcfaa51fdb1dd231a27595c873ed (patch)
tree43226fee7292a9a4912ea1d3d0d9728d2aefbcfd /miasm2/jitter
parent86e458d488b02bf3479f9c5a42bb56de23c3ea80 (diff)
parent253547e35343aed844e7bcb033c610409fcbd21e (diff)
downloadmiasm-7c0d412120abbcfaa51fdb1dd231a27595c873ed.tar.gz
miasm-7c0d412120abbcfaa51fdb1dd231a27595c873ed.zip
Merge pull request #828 from serpilliere/fix_lgtm_1
Code cleaning: lgtm.com
Diffstat (limited to '')
-rw-r--r--miasm2/jitter/codegen.py9
-rw-r--r--miasm2/jitter/jitcore_python.py3
-rw-r--r--miasm2/jitter/jitload.py4
3 files changed, 2 insertions, 14 deletions
diff --git a/miasm2/jitter/codegen.py b/miasm2/jitter/codegen.py
index 69e83de5..ff6c1485 100644
--- a/miasm2/jitter/codegen.py
+++ b/miasm2/jitter/codegen.py
@@ -336,26 +336,17 @@ class CGen(object):
             offset = int(expr)
             loc_key = self.ir_arch.loc_db.get_or_create_offset_location(offset)
             self.add_label_index(dst2index, loc_key)
-
-            value, int_size = int_size_to_bn(offset, 64)
             out = hex(offset)
-
             return ("%s" % dst2index[loc_key], out)
         if expr.is_loc():
             loc_key = expr.loc_key
             offset = self.ir_arch.loc_db.get_location_offset(expr.loc_key)
             if offset is not None:
                 self.add_label_index(dst2index, loc_key)
-
-                value, int_size = int_size_to_bn(offset, 64)
                 out = hex(offset)
-
                 return ("%s" % dst2index[loc_key], out)
             self.add_label_index(dst2index, loc_key)
-
-            value, int_size = int_size_to_bn(0, 64)
             out = hex(0)
-
             return ("%s" % dst2index[loc_key], out)
         dst2index[expr] = -1
         return ("-1", self.id_to_c(expr))
diff --git a/miasm2/jitter/jitcore_python.py b/miasm2/jitter/jitcore_python.py
index b97727cd..dd4c543e 100644
--- a/miasm2/jitter/jitcore_python.py
+++ b/miasm2/jitter/jitcore_python.py
@@ -1,7 +1,7 @@
 import miasm2.jitter.jitcore as jitcore
 import miasm2.expression.expression as m2_expr
 import miasm2.jitter.csts as csts
-from miasm2.expression.simplifications import ExpressionSimplifier, expr_simp_explicit
+from miasm2.expression.simplifications import expr_simp_explicit
 from miasm2.jitter.emulatedsymbexec import EmulatedSymbExec
 
 ################################################################################
@@ -59,7 +59,6 @@ class JitCore_Python(jitcore.JitCore):
             exec_engine = self.symbexec
             expr_simp = exec_engine.expr_simp
 
-            known_loc_keys = set(irb.loc_key for irb in irblocks)
             # For each irbloc inside irblocks
             while True:
                 # Get the current bloc
diff --git a/miasm2/jitter/jitload.py b/miasm2/jitter/jitload.py
index 39ca3d56..89f5bada 100644
--- a/miasm2/jitter/jitload.py
+++ b/miasm2/jitter/jitload.py
@@ -2,12 +2,11 @@
 import logging
 import warnings
 from functools import wraps
-from collections import Sequence, namedtuple, Iterator
+from collections import Sequence, namedtuple
 
 from miasm2.jitter.csts import *
 from miasm2.core.utils import *
 from miasm2.core.bin_stream import bin_stream_vm
-from miasm2.core.interval import interval
 from miasm2.jitter.emulatedsymbexec import EmulatedSymbExec
 from miasm2.jitter.codegen import CGen
 from miasm2.jitter.jitcore_cc_base import JitCore_Cc_Base
@@ -131,7 +130,6 @@ class CallbackHandlerBitflag(CallbackHandler):
         callbacks return True, continue with next callback.
         Iterator on other results"""
 
-        res = True
         for bitflag_expected in self.callbacks:
             if bitflag_expected & bitflag == bitflag_expected:
                 # If the flag matched