Fix recursive module assertion, broken recent lib commit (#5891 partial fix)

This commit is contained in:
Wilson Snyder 2025-06-30 20:30:27 -04:00
parent d455ec6229
commit cd0f35fe67
1 changed files with 3 additions and 1 deletions

View File

@ -621,7 +621,9 @@ class LinkCellsVisitor final : public VNVisitor {
if (libFoundp && libFoundp == nodep) {
// Ok
} else if (libFoundp && !globalFoundp) {
nodep->v3fatalSrc("Module should be found globally if inserted in lib");
// Clones are locally made and don't need to user-resolve globally
UASSERT_OBJ(nodep->recursiveClone(), nodep,
"Module should be found globally if inserted in lib");
} else if (libFoundp) {
if (!(libFoundp->fileline()->warnIsOff(V3ErrorCode::MODDUP)
|| nodep->fileline()->warnIsOff(V3ErrorCode::MODDUP)