Index: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h =================================================================== --- llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h +++ llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h @@ -303,7 +303,8 @@ /// Add an edge to this block. void addEdge(Edge::Kind K, Edge::OffsetT Offset, Symbol &Target, Edge::AddendT Addend) { - assert(!isZeroFill() && "Adding edge to zero-fill block?"); + assert((K < Edge::FirstRelocation || !isZeroFill()) && + "Adding edge to zero-fill block?"); Edges.push_back(Edge(K, Offset, Target, Addend)); } Index: llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.h =================================================================== --- llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.h +++ llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.h @@ -128,14 +128,14 @@ // Copy Block data and apply fixups. LLVM_DEBUG(dbgs() << " Applying fixups.\n"); - assert((!B->isZeroFill() || B->edges_size() == 0) && - "Edges in zero-fill block?"); for (auto &E : B->edges()) { // Skip non-relocation edges. if (!E.isRelocation()) continue; + assert(!B->isZeroFill() && "Edges in zero-fill block?"); + // Dispatch to LinkerImpl for fixup. if (auto Err = impl().applyFixup(G, *B, E)) return Err;