Merge pull request #26 from QuantamHD/fix_memory_leak
Fixes memory leak in verilog attribute code.
This commit is contained in:
commit
1b5c4e2745
|
|
@ -505,9 +505,14 @@ attr_specs:
|
||||||
|
|
||||||
attr_spec:
|
attr_spec:
|
||||||
ID
|
ID
|
||||||
{ $$ = new sta::VerilogAttributeEntry($1, "1"); }
|
{ $$ = new sta::VerilogAttributeEntry($1, "1");
|
||||||
|
delete[] $1;
|
||||||
|
}
|
||||||
| ID '=' attr_spec_value
|
| ID '=' attr_spec_value
|
||||||
{ $$ = new sta::VerilogAttributeEntry($1, $3); }
|
{ $$ = new sta::VerilogAttributeEntry($1, $3);
|
||||||
|
delete[] $1;
|
||||||
|
delete[] $3;
|
||||||
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
attr_spec_value:
|
attr_spec_value:
|
||||||
|
|
|
||||||
|
|
@ -424,8 +424,11 @@ VerilogReader::makeDcl(PortDirection *dir,
|
||||||
dcl_count_++;
|
dcl_count_++;
|
||||||
return new VerilogDcl(dir, assign_args, attribute_stmts, line);
|
return new VerilogDcl(dir, assign_args, attribute_stmts, line);
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
|
attribute_stmts->deleteContents();
|
||||||
|
delete attribute_stmts;
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
dcl_count_++;
|
dcl_count_++;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue