Index: tools/llvm-cfi-verify/GraphBuilder.cpp =================================================================== --- tools/llvm-cfi-verify/GraphBuilder.cpp +++ tools/llvm-cfi-verify/GraphBuilder.cpp @@ -98,8 +98,12 @@ CFNs.insert(FlowNode); } - for (const auto &FlowNode : OrphanedNodes) - CFNs.insert(FlowNode); + for (auto &FlowNode : OrphanedNodes) { + while (FlowNode) { + CFNs.insert(FlowNode); + FlowNode = FlowNode->Next; + } + } for (const auto &Node : CFNs) delete Node;