mirror of
https://github.com/verilator/verilator.git
synced 2026-09-01 18:36:28 +02:00
Fix duplicate scope identifiers decoding (#5584)
Signed-off-by: Bartłomiej Chmiel <[email protected]> Co-authored-by: Ryszard Rozak <[email protected]>
This commit is contained in:
co-authored by
Ryszard Rozak
parent
b3348a38d0
commit
4e71f359bf
+1
-12
@@ -156,7 +156,6 @@ class EmitCSyms final : EmitCBaseVisitorConst {
|
||||
}
|
||||
|
||||
static string scopeDecodeIdentifier(const string& scpname) {
|
||||
string out = scpname;
|
||||
string::size_type pos = string::npos;
|
||||
|
||||
// Remove hierarchy
|
||||
@@ -172,17 +171,7 @@ class EmitCSyms final : EmitCBaseVisitorConst {
|
||||
}
|
||||
}
|
||||
|
||||
if (pos != std::string::npos) out.erase(0, pos + 1);
|
||||
|
||||
// Decode all escaped characters
|
||||
while ((pos = out.find("__0")) != string::npos) {
|
||||
unsigned int x;
|
||||
std::stringstream ss;
|
||||
ss << std::hex << out.substr(pos + 3, 2);
|
||||
ss >> x;
|
||||
out.replace(pos, 5, 1, (char)x);
|
||||
}
|
||||
return out;
|
||||
return pos != string::npos ? scpname.substr(pos + 1) : scpname;
|
||||
}
|
||||
|
||||
/// (scp, m_vpiScopeCandidates, m_scopeNames) -> m_scopeNames
|
||||
|
||||
Reference in New Issue
Block a user