Bugfix in handling of multi-dimensional memories

This commit is contained in:
Clifford Wolf 2015-09-23 07:56:17 +02:00
parent 559929e341
commit 089c1e176f
1 changed files with 2 additions and 2 deletions

View File

@ -760,10 +760,10 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage,
if (i == 0) if (i == 0)
index_expr = new_index_expr; index_expr = new_index_expr;
else else
index_expr = new AstNode(AST_ADD, new AstNode(AST_MUL, index_expr, AstNode::mkconst_int(id2ast->multirange_dimensions[2*i-1], true)), new_index_expr); index_expr = new AstNode(AST_ADD, new AstNode(AST_MUL, index_expr, AstNode::mkconst_int(id2ast->multirange_dimensions[2*i+1], true)), new_index_expr);
} }
for (int i = GetSize(id2ast->multirange_dimensions)/1; i < GetSize(children[0]->children); i++) for (int i = GetSize(id2ast->multirange_dimensions)/2; i < GetSize(children[0]->children); i++)
children.push_back(children[0]->children[i]->clone()); children.push_back(children[0]->children[i]->clone());
delete children[0]; delete children[0];