diff --git a/llvm/lib/Transforms/IPO/ExtractFunction.cpp b/llvm/lib/Transforms/IPO/ExtractFunction.cpp index 482964e86f2c..2d291b7a8813 100644 --- a/llvm/lib/Transforms/IPO/ExtractFunction.cpp +++ b/llvm/lib/Transforms/IPO/ExtractFunction.cpp @@ -63,7 +63,7 @@ namespace { // can be "used", instead of ones with bodies. std::vector NewFunctions; - Function *Last = &M.back(); // Figure out where the last real fn is... + Function *Last = --M.end(); // Figure out where the last real fn is. for (Module::iterator I = M.begin(); ; ++I) { if (&*I != Named) {