Skip to content

Commit c672af6

Browse files
reject negatives
1 parent 621f95d commit c672af6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mypyc/irbuild/expression.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ def transform_index_expr(builder: IRBuilder, expr: IndexExpr) -> Value:
592592

593593
if isinstance(base.type, RTuple) and isinstance(
594594
folded_index := constant_fold_expr(builder, index), int
595-
):
595+
) and folded_index >= 0:
596596
return builder.add(TupleGet(base, folded_index, expr.line))
597597

598598
if isinstance(index, SliceExpr):

0 commit comments

Comments
 (0)