Commit d0672808 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Fixes

parent a742bc80
......@@ -827,7 +827,7 @@ static void emitBBs(IRGenState* irstate, const char* bb_type, GuardList& out_gua
if (full_blocks.count(b2) == 0 && partial_blocks.count(b2) == 0)
continue;
// printf("%d %d %ld %ld\n", b->idx, b2->idx, phi_ending_symbol_tables[b2]->size(), phis->size());
// printf("(%d %ld) -> (%d %ld)\n", b2->idx, phi_ending_symbol_tables[b2]->size(), b->idx, phis->size());
compareKeyset(phi_ending_symbol_tables[b2], phis);
assert(phi_ending_symbol_tables[b2]->size() == phis->size());
}
......
......@@ -2204,6 +2204,8 @@ private:
SourceInfo* source = irstate->getSourceInfo();
ScopeInfo* scope_info = irstate->getScopeInfo();
// Additional names to remove; remove them after iteration is done to new mess up the iterators
std::vector<std::string> also_remove;
for (SymbolTable::iterator it = symbol_table.begin(); it != symbol_table.end();) {
if (allowableFakeEndingSymbol(it->first)) {
++it;
......@@ -2216,6 +2218,8 @@ private:
if (!source->liveness->isLiveAtEnd(it->first, myblock)) {
// printf("%s dead at end of %d; grabbed = %d, %d vrefs\n", it->first.c_str(), myblock->idx,
// it->second->isGrabbed(), it->second->getVrefs());
also_remove.push_back(getIsDefinedName(it->first));
it->second->decvref(emitter);
it = symbol_table.erase(it);
} else if (source->phis->isRequiredAfter(it->first, myblock)) {
......@@ -2245,6 +2249,10 @@ private:
}
}
for (const auto& s : also_remove) {
symbol_table.erase(s);
}
const PhiAnalysis::RequiredSet& all_phis = source->phis->getAllRequiredAfter(myblock);
for (PhiAnalysis::RequiredSet::const_iterator it = all_phis.begin(), end = all_phis.end(); it != end; ++it) {
// printf("phi will be required for %s\n", it->c_str());
......
......@@ -2200,6 +2200,8 @@ public:
node->body[i]->accept(this);
}
popRegion(); // for the retrun
AST_Call* exit_call = makeCall(makeName(exitname_buf, AST_TYPE::Load, node->lineno));
exit_call->args.push_back(makeName("None", AST_TYPE::Load, node->lineno));
exit_call->args.push_back(makeName("None", AST_TYPE::Load, node->lineno));
......@@ -2242,7 +2244,6 @@ public:
curblock = orig_ending_block;
}
popRegion(); // for the retrun
if (return_dest->predecessors.size() == 0) {
delete return_dest;
} else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment