Skip to content

Commit

Permalink
chore[ir]: sanity check types in for range codegen (#3968)
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper authored May 15, 2024
1 parent 41a3e08 commit 626cdf9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions vyper/codegen/stmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ def _parse_For_range(self):
s.arg: Expr.parse_value_expr(s.value, self.context) for s in range_call.keywords
}

# sanity check that the following `end - start` is a valid operation
assert start.typ == end.typ == target_type

if "bound" in kwargs:
with end.cache_when_complex("end") as (b1, end):
# note: the check for rounds<=rounds_bound happens in asm
Expand Down

0 comments on commit 626cdf9

Please # to comment.