diff options
Diffstat (limited to '')
| -rw-r--r-- | miasm2/expression/expression.py | 16 | ||||
| -rw-r--r-- | miasm2/expression/expression_reduce.py | 6 | ||||
| -rw-r--r-- | miasm2/expression/simplifications_common.py | 6 | ||||
| -rw-r--r-- | miasm2/expression/simplifications_cond.py | 8 |
4 files changed, 18 insertions, 18 deletions
diff --git a/miasm2/expression/expression.py b/miasm2/expression/expression.py index 4dc16f75..e7657860 100644 --- a/miasm2/expression/expression.py +++ b/miasm2/expression/expression.py @@ -108,7 +108,7 @@ def visit_chk(visitor): class DiGraphExpr(DiGraph): - """Enhanced graph for Expression diplay + """Enhanced graph for Expression display Expression are displayed as a tree with node and edge labeled with only relevant information""" @@ -187,7 +187,7 @@ class Expr(object): raise ValueError('size is not mutable') def __init__(self, size): - """Instanciate an Expr with size @size + """Instantiate an Expr with size @size @size: int """ # Common attribute @@ -1343,7 +1343,7 @@ class ExprCompose(Expr): def is_compose(self): return True -# Expression order for comparaison +# Expression order for comparison EXPR_ORDER_DICT = {ExprId: 1, ExprLoc: 2, ExprCond: 3, @@ -1416,7 +1416,7 @@ def compare_exprs(expr1, expr2): return cmp(expr1.size, expr2.size) elif cls1 == ExprAssign: raise NotImplementedError( - "Comparaison from an ExprAssign not yet implemented") + "Comparison from an ExprAssign not yet implemented") elif cls2 == ExprCond: ret = compare_exprs(expr1.cond, expr2.cond) if ret: @@ -1447,7 +1447,7 @@ def compare_exprs(expr1, expr2): elif cls1 == ExprCompose: return compare_expr_list_compose(expr1.args, expr2.args) raise NotImplementedError( - "Comparaison between %r %r not implemented" % (expr1, expr2)) + "Comparison between %r %r not implemented" % (expr1, expr2)) def canonize_expr_list(expr_list): @@ -1554,7 +1554,7 @@ def match_expr(expr, pattern, tks, result=None): """Try to match the @pattern expression with the pattern @expr with @tks jokers. Result is output dictionary with matching joker values. @expr : Expr pattern - @pattern : Targetted Expr to match + @pattern : Targeted Expr to match @tks : list of ExprId, available jokers @result : dictionary of ExprId -> Expr, output matching context """ @@ -1991,7 +1991,7 @@ def expr_is_sNaN(expr): def expr_is_float_lower(op1, op2): """Return 1 on 1 bit if @op1 < @op2, 0 otherwise. /!\ Assume @op1 and @op2 are not NaN - Comparision is the floating point one, defined in IEEE754 + Comparison is the floating point one, defined in IEEE754 """ sign1, sign2 = op1.msb(), op2.msb() magn1, magn2 = op1[:-1], op2[:-1] @@ -2005,7 +2005,7 @@ def expr_is_float_lower(op1, op2): def expr_is_float_equal(op1, op2): """Return 1 on 1 bit if @op1 == @op2, 0 otherwise. /!\ Assume @op1 and @op2 are not NaN - Comparision is the floating point one, defined in IEEE754 + Comparison is the floating point one, defined in IEEE754 """ sign1, sign2 = op1.msb(), op2.msb() magn1, magn2 = op1[:-1], op2[:-1] diff --git a/miasm2/expression/expression_reduce.py b/miasm2/expression/expression_reduce.py index 0099dd78..adad552e 100644 --- a/miasm2/expression/expression_reduce.py +++ b/miasm2/expression/expression_reduce.py @@ -16,7 +16,7 @@ log_reduce.setLevel(logging.WARNING) class ExprNode(object): - """Clone of Expression object with additionnal information""" + """Clone of Expression object with additional information""" def __init__(self, expr): self.expr = expr @@ -211,7 +211,7 @@ class ExprReducer(object): """Recursively apply rules to @node @node: ExprNode to analyze - @lvl: actual recusion level + @lvl: actual recursion level """ expr = node.expr @@ -267,7 +267,7 @@ class ExprReducer(object): """Find and apply reduction rules to @node @node: ExprNode to analyse - @lvl: actuel recusion level + @lvl: actuel recursion level """ for rule in self.reduction_rules: diff --git a/miasm2/expression/simplifications_common.py b/miasm2/expression/simplifications_common.py index 7bdfd33b..6f0eb34a 100644 --- a/miasm2/expression/simplifications_common.py +++ b/miasm2/expression/simplifications_common.py @@ -23,7 +23,7 @@ def simp_cst_propagation(e_s, expr): op_name = expr.op # simpl integer manip # int OP int => int - # TODO: <<< >>> << >> are architecture dependant + # TODO: <<< >>> << >> are architecture dependent if op_name in op_propag_cst: while (len(args) >= 2 and args[-1].is_int() and @@ -240,7 +240,7 @@ def simp_cst_propagation(e_s, expr): else: # Do not consider this case, too tricky (overflow on addition / - # substraction) + # subtraction) pass # A >> X >> Y => A >> (X+Y) if X + Y does not overflow @@ -284,7 +284,7 @@ def simp_cst_propagation(e_s, expr): # ! (!X + int) => X - int # TODO - # ((A & mask) >> shift) whith mask < 2**shift => 0 + # ((A & mask) >> shift) with mask < 2**shift => 0 if op_name == ">>" and args[1].is_int() and args[0].is_op("&"): if (args[0].args[1].is_int() and 2 ** args[1].arg > args[0].args[1].arg): diff --git a/miasm2/expression/simplifications_cond.py b/miasm2/expression/simplifications_cond.py index f6b1ea8b..f1c224b7 100644 --- a/miasm2/expression/simplifications_cond.py +++ b/miasm2/expression/simplifications_cond.py @@ -1,8 +1,8 @@ ################################################################################ # -# By choice, Miasm2 does not handle comparaison as a single operation, but with -# operations corresponding to comparaison computation. -# One may want to detect those comparaison; this library is designed to add them +# By choice, Miasm2 does not handle comparison as a single operation, but with +# operations corresponding to comparison computation. +# One may want to detect those comparison; this library is designed to add them # in Miasm2 engine thanks to : # - Conditions computation in ExprOp # - Simplifications to catch known condition forms @@ -132,7 +132,7 @@ def expr_simp_inverse(expr_simp, e): to_match, [jok1, jok2, jok_small]) - # Check for 2 symetric cases + # Check for 2 symmetric cases if r is False: to_match = (ExprOp_inf_signed(jok1, jok2) ^ jok_small) r = __match_expr_wrap(e, |