Tests: Fix leak found by previous commit

This commit is contained in:
Wilson Snyder 2021-02-25 20:38:38 -05:00
parent e1a48dcb07
commit dad86b9a84
2 changed files with 3 additions and 2 deletions

View File

@ -786,8 +786,8 @@ private:
// Static doesn't need save-restore as if below will re-fill proper value
stmt += "static int __Vfuncnum = -1;\n";
// First time init (faster than what the compiler does if we did a singleton
stmt += "if (VL_UNLIKELY(__Vfuncnum == -1)) { __Vfuncnum = Verilated::exportFuncNum(\""
+ nodep->cname() + "\"); }\n";
stmt += "if (VL_UNLIKELY(__Vfuncnum == -1)) __Vfuncnum = Verilated::exportFuncNum(\""
+ nodep->cname() + "\");\n";
// If the find fails, it will throw an error
stmt += "const VerilatedScope* __Vscopep = Verilated::dpiScope();\n";
// If dpiScope is fails and is null; the exportFind function throws and error

View File

@ -90,6 +90,7 @@ int main(int argc, char** argv, char** env) {
#ifdef TEST_HDR_TRACE
if (tfp) tfp->close();
VL_DO_DANGLING(delete tfp, tfp);
#endif
VL_DO_DANGLING(delete ap, ap);