From: Clifford Wolf Date: Fri, 11 Jul 2014 11:05:53 +0000 (+0200) Subject: Fixed processing of initial values for block-local variables X-Git-Tag: yosys-0.4~570 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=55a1b8dbac91373979289c535bed61a32717f62b;p=yosys.git Fixed processing of initial values for block-local variables --- diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc index db7f5ca34..e547ede36 100644 --- a/frontends/ast/simplify.cc +++ b/frontends/ast/simplify.cc @@ -423,6 +423,11 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage, if (did_something_here) did_something = true; } + if (stage == 2 && children[i]->type == AST_INITIAL && current_ast_mod != this) { + current_ast_mod->children.push_back(children[i]); + children.erase(children.begin() + (i--)); + did_something = true; + } } for (auto &attr : attributes) { while (attr.second->simplify(true, false, false, stage, -1, false, true))