From 3ccd47f76289fcea66cdb7199961c2b181b9b318 Mon Sep 17 00:00:00 2001 From: Tristan Menzel Date: Wed, 24 Jan 2024 09:57:13 -0800 Subject: [PATCH] fix: Add slot range validation to range expressions which specify a step --- src/puya/awst_build/module.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/puya/awst_build/module.py b/src/puya/awst_build/module.py index 68d1d77f21..c41865b318 100644 --- a/src/puya/awst_build/module.py +++ b/src/puya/awst_build/module.py @@ -622,7 +622,10 @@ def map_urange_args(args: list[mypy.nodes.Expression]) -> range: mypy.nodes.IntExpr(value=stop), mypy.nodes.IntExpr(value=step), ]: - return range(start, stop, step) + the_range = range(start, stop, step) + for slot in the_range: + check_slot_is_in_range(slot) + return the_range case _: raise CodeError("Unexpected arguments for urange", source_location)