From 626cdf941b825b799069b901f4364e13ffa3370e Mon Sep 17 00:00:00 2001 From: Charles Cooper Date: Wed, 15 May 2024 16:50:24 -0400 Subject: [PATCH] chore[ir]: sanity check types in for range codegen (#3968) --- vyper/codegen/stmt.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vyper/codegen/stmt.py b/vyper/codegen/stmt.py index 1018a6ec43..8ca7b98587 100644 --- a/vyper/codegen/stmt.py +++ b/vyper/codegen/stmt.py @@ -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