Fix coverage of class methods (#3998).

This commit is contained in:
Wilson Snyder
2023-03-03 19:26:15 -05:00
parent 12728bc478
commit ab502c5196
10 changed files with 463 additions and 381 deletions
+4 -1
View File
@@ -124,7 +124,10 @@ private:
UINFO(9, "new " << declp << endl);
AstCoverInc* const incp = new AstCoverInc{fl, declp};
if (!trace_var_name.empty() && v3Global.opt.traceCoverage()) {
if (!trace_var_name.empty()
&& v3Global.opt.traceCoverage()
// No module handle to trace inside classes
&& !VN_IS(m_modp, Class)) {
FileLine* const fl_nowarn = new FileLine{incp->fileline()};
fl_nowarn->modifyWarnOff(V3ErrorCode::UNUSEDSIGNAL, true);
AstVar* const varp = new AstVar{fl_nowarn, VVarType::MODULETEMP, trace_var_name,