summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/VMCore/AsmWriter.cpp5
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;
}
}
}