Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: broken references to mk_add and mk_mul #144

Merged
merged 1 commit into from
Jul 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/halmos/sevm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,7 @@ def arith(self, ex: Exec, op: int, w1: Word, w2: Word) -> Word:
if is_bv_value(w1) and is_bv_value(w2):
return w1 + w2
else:
return mk_add(w1, w2)
return self.mk_add(w1, w2)
elif op == EVM.SUB:
if self.options.get("sub"):
return w1 - w2
Expand All @@ -1117,17 +1117,17 @@ def arith(self, ex: Exec, op: int, w1: Word, w2: Word) -> Word:
elif is_power_of_two(i1):
return w2 << int(math.log(i1, 2))
else:
return mk_mul(w1, w2)
return self.mk_mul(w1, w2)
elif is_bv_value(w2):
i2: int = int(str(w2)) # must be concrete
if i2 == 0:
return w2
elif is_power_of_two(i2):
return w1 << int(math.log(i2, 2))
else:
return mk_mul(w1, w2)
return self.mk_mul(w1, w2)
else:
return mk_mul(w1, w2)
return self.mk_mul(w1, w2)
elif op == EVM.DIV:
div_for_overflow_check = self.div_xy_y(w1, w2)
if div_for_overflow_check is not None: # xy/x or xy/y
Expand Down