Don't dereference the end() iterator. Thanks to
authorDan Gohman <gohman@apple.com>
Mon, 6 Oct 2008 18:00:07 +0000 (18:00 +0000)
committerDan Gohman <gohman@apple.com>
Mon, 6 Oct 2008 18:00:07 +0000 (18:00 +0000)
ENABLE_EXPENSIVE_CHECKS for finding this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57181 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/VirtRegMap.cpp

index f03db748973e18c6dfe6914069534f63dc257ad2..26d019b284167f18fa77e16bc54944eb5778f5f4 100644 (file)
@@ -143,7 +143,7 @@ int VirtRegMap::getEmergencySpillSlot(const TargetRegisterClass *RC) {
     LowSpillSlot = SS;
   if (HighSpillSlot == NO_STACK_SLOT || SS > HighSpillSlot)
     HighSpillSlot = SS;
-  I->second = SS;
+  EmergencySpillSlots[RC] = SS;
   return SS;
 }