diff --git a/include/llvm/IR/IRBuilder.h b/include/llvm/IR/IRBuilder.h index cdf840f5415..80a2ede4da1 100644 --- a/include/llvm/IR/IRBuilder.h +++ b/include/llvm/IR/IRBuilder.h @@ -90,6 +90,7 @@ public: void SetInsertPoint(Instruction *I) { BB = I->getParent(); InsertPt = I; + assert(I != BB->end() && "Can't read debug loc from end()"); SetCurrentDebugLocation(I->getDebugLoc()); }