Fix `free` collision (#6675)

This commit is contained in:
Todd Strader 2025-11-10 16:44:41 -05:00 committed by GitHub
parent 8e35c81399
commit 34f63396cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View File

@ -253,7 +253,7 @@ class EmitCImp final : public EmitCFunc {
} else {
putns(modp, "void " + modName + "::dtor() {\n");
}
putns(modp, "VL_DO_DANGLING(free(const_cast<char*>(vlNamep)), vlNamep);\n");
putns(modp, "VL_DO_DANGLING(std::free(const_cast<char*>(vlNamep)), vlNamep);\n");
emitSystemCSection(modp, VSystemCSectionType::DTOR);
puts("}\n");
}

View File

@ -13,6 +13,7 @@ module t (/*AUTOARG*/
reg vector; // OK, as not public
reg switch /*verilator public*/; // Bad
reg free /*verilator public*/; // OK, not actually a keyword
initial begin
$write("*-* All Finished *-*\n");