From: Lukasz Dalek Date: Fri, 17 Jul 2020 12:37:44 +0000 (+0200) Subject: Fix subarray access condition X-Git-Tag: working-ls180~274^2~1 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ba08c251333c0002d8cd68d515533ef0614522fd;p=yosys.git Fix subarray access condition Signed-off-by: Lukasz Dalek --- diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc index 66f22e113..a166f8a89 100644 --- a/frontends/ast/simplify.cc +++ b/frontends/ast/simplify.cc @@ -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();