Skip to content

Commit

Permalink
fix: Add slot range validation to range expressions which specify a step
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanmenzel authored and daniel-makerx committed Jan 25, 2024
1 parent ad09eb8 commit 3ccd47f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/puya/awst_build/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 3ccd47f

Please sign in to comment.