mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-22 13:44:59 -07:00
Slice and substring bounds checking
This commit is contained in:
@@ -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