Slice and substring bounds checking

This commit is contained in:
Ginger Bill
2016-09-12 15:10:15 +01:00
parent 9ff4a8b5ab
commit d4ba6b5466
3 changed files with 107 additions and 37 deletions
+3
View File
@@ -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;