diff options
author | Clifford Wolf <clifford@clifford.at> | 2014-07-11 13:05:53 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2014-07-11 13:05:53 +0200 |
commit | 55a1b8dbac91373979289c535bed61a32717f62b (patch) | |
tree | db3700337815e41c5cec7612ca084e92789ef4e5 /frontends | |
parent | 3b52121d328d45a5d4269fd0e8de9af948c0216e (diff) | |
download | yosys-55a1b8dbac91373979289c535bed61a32717f62b.tar.gz yosys-55a1b8dbac91373979289c535bed61a32717f62b.tar.bz2 yosys-55a1b8dbac91373979289c535bed61a32717f62b.zip |
Fixed processing of initial values for block-local variables
Diffstat (limited to 'frontends')
-rw-r--r-- | frontends/ast/simplify.cc | 5 |
1 files changed, 5 insertions, 0 deletions
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)) |