Skip to content

Commit

Permalink
fix index clamping in extract32
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberthirst committed Apr 4, 2024
1 parent 19b1402 commit 17aee50
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vyper/builtins/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ def finalize(ret):
with bytez.cache_when_complex("_sub") as (b1, bytez):
# merge
length = get_bytearray_length(bytez)
index = clamp("lt", index, ["sub", length, 32])
index = clamp2(0, index, ["sub", length, 32], signed=True)
with index.cache_when_complex("_index") as (b2, index):
assert not index.typ.is_signed

Expand Down

0 comments on commit 17aee50

Please sign in to comment.