Plug memory leaks (#5016)

This commit is contained in:
Geza Lore
2024-03-23 22:12:43 +00:00
committed by GitHub
parent 38ad328956
commit 9b729b80e0
16 changed files with 70 additions and 29 deletions
+5
View File
@@ -168,6 +168,11 @@ AstVar* V3ParseGrammar::createVariable(FileLine* fileline, const string& name,
if (GRAMMARP->m_varIO == VDirection::NONE && GRAMMARP->m_varDecl == VVarType::PORT) {
// Just a port list with variable name (not v2k format); AstPort already created
if (dtypep) fileline->v3warn(E_UNSUPPORTED, "Unsupported: Ranges ignored in port-lists");
if (arrayp) VL_DO_DANGLING(arrayp->deleteTree(), arrayp);
if (attrsp) {
// TODO: Merge attributes across list? Or warn attribute is ignored
VL_DO_DANGLING(attrsp->deleteTree(), attrsp);
}
return nullptr;
}
if (GRAMMARP->m_varDecl == VVarType::WREAL) {