diff options
author | Chris Lattner <sabre@nondot.org> | 2004-06-15 21:07:32 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-06-15 21:07:32 +0000 |
commit | d1cd3285601d4accf370779ac520c1e494a08b87 (patch) | |
tree | d24609155c8fc88c9137e51dd1da2b809f8a30b7 /lib/VMCore/AsmWriter.cpp | |
parent | f405280acb887d418cb63b8d330b16e6c0c4e3a4 (diff) | |
download | external_llvm-d1cd3285601d4accf370779ac520c1e494a08b87.zip external_llvm-d1cd3285601d4accf370779ac520c1e494a08b87.tar.gz external_llvm-d1cd3285601d4accf370779ac520c1e494a08b87.tar.bz2 |
Do not dereference end iterators. It's really bad for the asmwriter's health.
This possibly fixes PR370
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14181 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/AsmWriter.cpp')
-rw-r--r-- | lib/VMCore/AsmWriter.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index 3484d39..570d5b3 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -1324,7 +1324,10 @@ int SlotMachine::getSlot(const Value *V) { // Return the slot number as the module's contribution to // the type plane plus the index in the function's contribution // to the type plane. - return MI->second.next_slot + FVI->second; + if (MI != mMap.end()) + return MI->second.next_slot + FVI->second; + else + return FVI->second; } } } |