add sum expression to bitvec

pull/813/head
Joran Honig 6 years ago
parent ed2ca48e5b
commit a89461228e
  1. 9
      mythril/laser/smt/bitvec.py

@ -126,3 +126,12 @@ def UDiv(a: BitVec, b: BitVec) -> BitVec:
""" Create an unsigned division expression """
union = a.annotations + b.annotations
return BitVec(z3.UDiv(a.raw, b.raw), annotations=union)
def Sum(*args) -> BitVec:
""" Create sum expression"""
nraw = z3.Sum([a.raw for a in args])
annotations = []
for bv in args:
annotations += bv.annotations
return BitVec(nraw, annotations)

Loading…
Cancel
Save