diff --git a/src/V3Task.cpp b/src/V3Task.cpp index b58cc0c78..8f0663b1e 100644 --- a/src/V3Task.cpp +++ b/src/V3Task.cpp @@ -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 diff --git a/test_regress/t/t_trace_two_cc.cpp b/test_regress/t/t_trace_two_cc.cpp index 87c7ebb5f..4b445b8ed 100644 --- a/test_regress/t/t_trace_two_cc.cpp +++ b/test_regress/t/t_trace_two_cc.cpp @@ -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);