From 17aee50644e7005f37f790c5597b3146713bd2a4 Mon Sep 17 00:00:00 2001 From: cyberthirst Date: Thu, 4 Apr 2024 14:38:46 +0200 Subject: [PATCH] fix index clamping in extract32 --- vyper/builtins/functions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vyper/builtins/functions.py b/vyper/builtins/functions.py index 1e6192f025..05d6dcb8b3 100644 --- a/vyper/builtins/functions.py +++ b/vyper/builtins/functions.py @@ -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