Slice and substring bounds checking
This commit is contained in:
1 parent
9ff4a8b5ab
commit
d4ba6b5466
3 files changed
+107
-37
No files matched your search
@@ -3347,6 +3347,9 @@ ExprKind check__expr_base(Checker *c, Operand *o, AstNode *node, Type *type_hint
|
||||
if (o->mode == Addressing_Constant) {
|
||||
max_count = o->value.value_string.len;
|
||||
}
|
||||
if (se->max != NULL) {
|
||||
error(&c->error_collector, ast_node_token(se->max), "Max (3rd) index not needed in substring expression");
|
||||
}
|
||||
o->type = t_string;
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in new issue
Block a user