Fix --protect-ids when using SV classes (#2994)

A few names were incorrectly mangled, which made --protect-ids produce
invalid output when certain SV class constructs were uses. Now fixed and
added a few extra tests to catch this.
This commit is contained in:
Geza Lore
2021-05-31 13:40:22 +01:00
committed by GitHub
parent e4dcbb22e3
commit e1f9fffb42
7 changed files with 139 additions and 2 deletions
+2 -1
View File
@@ -1157,7 +1157,8 @@ private:
cfuncp->argTypes(EmitCBaseVisitor::symClassVar());
if (cfuncp->name() == "new") {
cfuncp->addInitsp(
new AstCStmt(nodep->fileline(), "_ctor_var_reset(vlSymsp);\n"));
new AstCStmt(nodep->fileline(),
VIdProtect::protect("_ctor_var_reset") + "(vlSymsp);\n"));
}
}
}