mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Fix #2267 by making it an error
This commit is contained in:
+3
-1
@@ -7323,7 +7323,9 @@ gb_internal void check_matrix_index_expr(CheckerContext *c, Operand *o, Ast *nod
|
|||||||
i64 column_index = 0;
|
i64 column_index = 0;
|
||||||
bool row_ok = check_index_value(c, t, false, ie->row_index, row_count, &row_index, nullptr);
|
bool row_ok = check_index_value(c, t, false, ie->row_index, row_count, &row_index, nullptr);
|
||||||
bool column_ok = check_index_value(c, t, false, ie->column_index, column_count, &column_index, nullptr);
|
bool column_ok = check_index_value(c, t, false, ie->column_index, column_count, &column_index, nullptr);
|
||||||
|
if (is_const && (ie->row_index->tav.mode != Addressing_Constant || ie->column_index->tav.mode != Addressing_Constant)) {
|
||||||
|
error(o->expr, "Cannot index constant matrix with non-constant indices '%s'", expr_to_string(node));
|
||||||
|
}
|
||||||
|
|
||||||
gb_unused(row_ok);
|
gb_unused(row_ok);
|
||||||
gb_unused(column_ok);
|
gb_unused(column_ok);
|
||||||
|
|||||||
Reference in New Issue
Block a user