diff options
author | Clifford Wolf <clifford@clifford.at> | 2019-08-07 12:14:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-07 12:14:54 +0200 |
commit | 679bc6507f08cab33de0c46b3a96bfaeab2069f4 (patch) | |
tree | 8a30dadbd3a11f644446f72fb3237abe0f2c418b /frontends | |
parent | c5d56fbe2d197b28a5d30983506af5d36868abd7 (diff) | |
parent | f1f5b4e375f6347424cf7877ed6415bf9c71420e (diff) | |
download | yosys-679bc6507f08cab33de0c46b3a96bfaeab2069f4.tar.gz yosys-679bc6507f08cab33de0c46b3a96bfaeab2069f4.tar.bz2 yosys-679bc6507f08cab33de0c46b3a96bfaeab2069f4.zip |
Merge pull request #1252 from YosysHQ/clifford/fix1231
Fix handling of functions/tasks without top-level begin-end block
Diffstat (limited to 'frontends')
-rw-r--r-- | frontends/ast/simplify.cc | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc index e947125bf..6fb94d80b 100644 --- a/frontends/ast/simplify.cc +++ b/frontends/ast/simplify.cc @@ -3439,19 +3439,11 @@ AstNode *AstNode::eval_const_function(AstNode *fcall) { std::map<std::string, AstNode*> backup_scope; std::map<std::string, AstNode::varinfo_t> variables; - bool delete_temp_block = false; - AstNode *block = NULL; + AstNode *block = new AstNode(AST_BLOCK); size_t argidx = 0; for (auto child : children) { - if (child->type == AST_BLOCK) - { - log_assert(block == NULL); - block = child; - continue; - } - if (child->type == AST_WIRE) { while (child->simplify(true, false, false, 1, -1, false, true)) { } @@ -3468,13 +3460,9 @@ AstNode *AstNode::eval_const_function(AstNode *fcall) continue; } - log_assert(block == NULL); - delete_temp_block = true; - block = new AstNode(AST_BLOCK); block->children.push_back(child->clone()); } - log_assert(block != NULL); log_assert(variables.count(str) != 0); while (!block->children.empty()) @@ -3642,8 +3630,7 @@ AstNode *AstNode::eval_const_function(AstNode *fcall) log_abort(); } - if (delete_temp_block) - delete block; + delete block; for (auto &it : backup_scope) if (it.second == NULL) |