aboutsummaryrefslogtreecommitdiffstats
path: root/frontends/ast
diff options
context:
space:
mode:
authorZachary Snow <zach@zachjs.com>2019-03-18 20:34:21 -0400
committerZachary Snow <zach@zachjs.com>2019-03-18 20:43:20 -0400
commita5f4b836376e1457847da4946c1e12d2d41dc4f4 (patch)
treee24fec68370fda597f489be075e4696d44f465f5 /frontends/ast
parent90bce0415622a3d7a64bca5914a0fb3abdd3cc5c (diff)
downloadyosys-a5f4b836376e1457847da4946c1e12d2d41dc4f4.tar.gz
yosys-a5f4b836376e1457847da4946c1e12d2d41dc4f4.tar.bz2
yosys-a5f4b836376e1457847da4946c1e12d2d41dc4f4.zip
fix local name resolution in prefix constructs
Diffstat (limited to 'frontends/ast')
-rw-r--r--frontends/ast/simplify.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc
index 1c9932ee0..d525c6b8a 100644
--- a/frontends/ast/simplify.cc
+++ b/frontends/ast/simplify.cc
@@ -2863,7 +2863,11 @@ void AstNode::expand_genblock(std::string index_var, std::string prefix, std::ma
for (size_t i = 0; i < children.size(); i++) {
AstNode *child = children[i];
- if (child->type != AST_FUNCTION && child->type != AST_TASK && child->type != AST_PREFIX)
+ // AST_PREFIX member names should not be prefixed; a nested AST_PREFIX
+ // still needs to recursed-into
+ if (type == AST_PREFIX && i == 1 && child->type == AST_IDENTIFIER)
+ continue;
+ if (child->type != AST_FUNCTION && child->type != AST_TASK)
child->expand_genblock(index_var, prefix, name_map);
}