mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 19:12:56 +02:00
Catch attempts to remove a deleted node from the CSE maps. Better to
catch this here rather than later after accessing uninitialized memory etc. Fires when compiling the testcase in PR8237. llvm-svn: 121635
This commit is contained in:
parent
13577458da
commit
47a4bbd31d
@ -611,9 +611,6 @@ void SelectionDAG::DeallocateNode(SDNode *N) {
|
|||||||
bool SelectionDAG::RemoveNodeFromCSEMaps(SDNode *N) {
|
bool SelectionDAG::RemoveNodeFromCSEMaps(SDNode *N) {
|
||||||
bool Erased = false;
|
bool Erased = false;
|
||||||
switch (N->getOpcode()) {
|
switch (N->getOpcode()) {
|
||||||
case ISD::EntryToken:
|
|
||||||
llvm_unreachable("EntryToken should not be in CSEMaps!");
|
|
||||||
return false;
|
|
||||||
case ISD::HANDLENODE: return false; // noop.
|
case ISD::HANDLENODE: return false; // noop.
|
||||||
case ISD::CONDCODE:
|
case ISD::CONDCODE:
|
||||||
assert(CondCodeNodes[cast<CondCodeSDNode>(N)->get()] &&
|
assert(CondCodeNodes[cast<CondCodeSDNode>(N)->get()] &&
|
||||||
@ -643,6 +640,8 @@ bool SelectionDAG::RemoveNodeFromCSEMaps(SDNode *N) {
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
// Remove it from the CSE Map.
|
// Remove it from the CSE Map.
|
||||||
|
assert(N->getOpcode() != ISD::DELETED_NODE && "DELETED_NODE in CSEMap!");
|
||||||
|
assert(N->getOpcode() != ISD::EntryToken && "EntryToken in CSEMap!");
|
||||||
Erased = CSEMap.RemoveNode(N);
|
Erased = CSEMap.RemoveNode(N);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user