Fix subarray access condition

Signed-off-by: Lukasz Dalek <ldalek@antmicro.com>
This commit is contained in:
Lukasz Dalek 2020-07-17 14:37:44 +02:00
parent c39ebe6ae0
commit ba08c25133
1 changed files with 1 additions and 1 deletions

View File

@ -1478,7 +1478,7 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage,
for (int i = 0; 2*i < GetSize(id2ast->multirange_dimensions); i++)
{
if (GetSize(children[0]->children) < i)
if (GetSize(children[0]->children) <= i)
log_file_error(filename, location.first_line, "Insufficient number of array indices for %s.\n", log_id(str));
AstNode *new_index_expr = children[0]->children[i]->children.at(0)->clone();