Fix misc memory leaks
This commit is contained in:
parent
be42dc906c
commit
fde380868a
|
|
@ -368,6 +368,7 @@ private:
|
||||||
inp = new AstVarRef{nodep->fileline(), invarp, VAccess::READ};
|
inp = new AstVarRef{nodep->fileline(), invarp, VAccess::READ};
|
||||||
}
|
}
|
||||||
nodep->replaceWith(inp);
|
nodep->replaceWith(inp);
|
||||||
|
VL_DO_DANGLING(pushDeletep(nodep), nodep);
|
||||||
}
|
}
|
||||||
|
|
||||||
//========== Move $sampled down to read-only variables
|
//========== Move $sampled down to read-only variables
|
||||||
|
|
|
||||||
|
|
@ -138,13 +138,16 @@ AstNodeDType* V3ParseGrammar::createArray(AstNodeDType* basep, AstNodeRange* nra
|
||||||
rangep};
|
rangep};
|
||||||
} else if (VN_IS(nrangep, UnsizedRange)) {
|
} else if (VN_IS(nrangep, UnsizedRange)) {
|
||||||
arrayp = new AstUnsizedArrayDType{nrangep->fileline(), VFlagChildDType{}, arrayp};
|
arrayp = new AstUnsizedArrayDType{nrangep->fileline(), VFlagChildDType{}, arrayp};
|
||||||
|
VL_DO_DANGLING(nrangep->deleteTree(), nrangep);
|
||||||
} else if (VN_IS(nrangep, BracketRange)) {
|
} else if (VN_IS(nrangep, BracketRange)) {
|
||||||
const AstBracketRange* const arangep = VN_AS(nrangep, BracketRange);
|
const AstBracketRange* const arangep = VN_AS(nrangep, BracketRange);
|
||||||
AstNode* const keyp = arangep->elementsp()->unlinkFrBack();
|
AstNode* const keyp = arangep->elementsp()->unlinkFrBack();
|
||||||
arrayp = new AstBracketArrayDType{nrangep->fileline(), VFlagChildDType{}, arrayp,
|
arrayp = new AstBracketArrayDType{nrangep->fileline(), VFlagChildDType{}, arrayp,
|
||||||
keyp};
|
keyp};
|
||||||
|
VL_DO_DANGLING(nrangep->deleteTree(), nrangep);
|
||||||
} else if (VN_IS(nrangep, WildcardRange)) {
|
} else if (VN_IS(nrangep, WildcardRange)) {
|
||||||
arrayp = new AstWildcardArrayDType{nrangep->fileline(), VFlagChildDType{}, arrayp};
|
arrayp = new AstWildcardArrayDType{nrangep->fileline(), VFlagChildDType{}, arrayp};
|
||||||
|
VL_DO_DANGLING(nrangep->deleteTree(), nrangep);
|
||||||
} else {
|
} else {
|
||||||
UASSERT_OBJ(0, nrangep, "Expected range or unsized range");
|
UASSERT_OBJ(0, nrangep, "Expected range or unsized range");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2105,7 +2105,8 @@ struct_union_member<memberDTypep>: // ==IEEE: struct_union_member
|
||||||
// // UNSUP random_qualifer not propagagted until have randomize support
|
// // UNSUP random_qualifer not propagagted until have randomize support
|
||||||
random_qualifierE data_type_or_void
|
random_qualifierE data_type_or_void
|
||||||
/*mid*/ { GRAMMARP->m_memDTypep = $2; } // As a list follows, need to attach this dtype to each member.
|
/*mid*/ { GRAMMARP->m_memDTypep = $2; } // As a list follows, need to attach this dtype to each member.
|
||||||
/*cont*/ list_of_member_decl_assignments ';' { $$ = $4; GRAMMARP->m_memDTypep = nullptr; }
|
/*cont*/ list_of_member_decl_assignments ';'
|
||||||
|
{ $$ = $4; DEL(GRAMMARP->m_memDTypep); GRAMMARP->m_memDTypep = nullptr; }
|
||||||
| vlTag { $$ = nullptr; }
|
| vlTag { $$ = nullptr; }
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue