Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
twizmwazin committed Nov 25, 2024
1 parent 875f835 commit c55be70
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions claripy/ast/bv.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ def BVS( # pylint:disable=redefined-builtin
name = name.decode()
if not isinstance(name, str):
raise TypeError(f"Name value for BVS must be a str, got {type(name)!r}")
if size is None or not isinstance(size, int):
raise TypeError("Size value for BVS must be an integer")

n = _make_name(name, size, False if explicit_name is None else explicit_name)
encoded_name = n.encode()
Expand Down
12 changes: 6 additions & 6 deletions claripy/backends/backend_vsa/strided_interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -2173,12 +2173,12 @@ def lshift(self, shift_amount):
new_lower_bound = None
new_upper_bound = None
for amount in range(lower, upper + 1):
lower = self.lower_bound << amount
if new_lower_bound is None or lower < new_lower_bound:
new_lower_bound = lower
upper = self.upper_bound << amount
if new_upper_bound is None or upper > new_upper_bound:
new_upper_bound = upper
lower_shifted = self.lower_bound << amount
if new_lower_bound is None or lower_shifted < new_lower_bound:
new_lower_bound = lower_shifted
upper_shifted = self.upper_bound << amount
if new_upper_bound is None or upper_shifted > new_upper_bound:
new_upper_bound = upper_shifted

# NOTE: If this is an arithmetic operation, we should take care
# of sign-changes.
Expand Down

0 comments on commit c55be70

Please sign in to comment.