Fix some cleanup code in the compiler

This commit is contained in:
Cary R 2021-01-07 23:53:11 -08:00
parent 9d3de84cd1
commit 1bffc649cb
2 changed files with 12 additions and 2 deletions

View File

@ -2658,7 +2658,10 @@ NetProc* PAssign::elaborate(Design*des, NetScope*scope) const
rv = elaborate_rval_(des, scope, lv_net_type, lv->expr_type(), count_lval_width(lv));
}
if (rv == 0) return 0;
if (rv == 0) {
delete lv;
return 0;
}
assert(rv);
if (count_) assert(event_);

View File

@ -1317,10 +1317,14 @@ int main(int argc, char*argv[])
cerr << "error: Code generation had "
<< emit_rc << " error(s)."
<< endl;
delete des;
EOC_cleanup();
return 1;
}
if (emit_rc < 0) {
cerr << "error: Code generator failure: " << emit_rc << endl;
delete des;
EOC_cleanup();
return -1;
}
assert(emit_rc);
@ -1362,7 +1366,10 @@ int main(int argc, char*argv[])
cerr << "***" << endl;
}
return des? des->errors : 1;
int rtn = des? des->errors : 1;
delete des;
EOC_cleanup();
return rtn;
}
static void find_module_mention(map<perm_string,bool>&check_map, Module*mod)