Fixed anonymous genblock object names
authorClifford Wolf <clifford@clifford.at>
Fri, 4 Nov 2016 06:46:30 +0000 (07:46 +0100)
committerClifford Wolf <clifford@clifford.at>
Fri, 4 Nov 2016 06:46:30 +0000 (07:46 +0100)
frontends/ast/simplify.cc

index 9d5c75fedc2b4d31f2362d9f0a772ba84cac828b..3432c61dac7224b2e66be23b410bdebc0d4339f6 100644 (file)
@@ -2660,7 +2660,7 @@ void AstNode::expand_genblock(std::string index_var, std::string prefix, std::ma
                        std::string new_name = prefix[0] == '\\' ? prefix.substr(1) : prefix;
                        size_t pos = child->str.rfind('.');
                        if (pos == std::string::npos)
-                               pos = child->str[0] == '\\' ? 1 : 0;
+                               pos = child->str[0] == '\\' && prefix[0] == '\\' ? 1 : 0;
                        else
                                pos = pos + 1;
                        new_name = child->str.substr(0, pos) + new_name + child->str.substr(pos);