]> granicus.if.org Git - clang/commitdiff
Reorder to avoid invalidating idx which is an accessor into VCall.
authorMike Stump <mrs@apple.com>
Wed, 6 Jan 2010 03:09:19 +0000 (03:09 +0000)
committerMike Stump <mrs@apple.com>
Wed, 6 Jan 2010 03:09:19 +0000 (03:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92819 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGVtable.cpp

index 40e774be13b1deba9c681002b9527571146dc51f..d89c6692f6e327d51460936117cedb8f29217656 100644 (file)
@@ -825,7 +825,6 @@ bool VtableBuilder::OverrideMethod(GlobalDecl GD, bool MorallyVirtual,
                   MD->getNameAsString().c_str(), (int)-idx-3,
                   (int)VCalls[idx-1], Class->getNameAsCString()));
       }
-      VCall[GD] = idx;
       int64_t NonVirtualAdjustment = NonVirtualOffset[GD];
       int64_t VirtualAdjustment = 
         -((idx + extra + 2) * LLVMPointerWidth / 8);
@@ -842,6 +841,7 @@ bool VtableBuilder::OverrideMethod(GlobalDecl GD, bool MorallyVirtual,
         SavedAdjustments.push_back(
             std::make_pair(GD, std::make_pair(OGD, ThisAdjustment)));
       }
+      VCall[GD] = idx;
       return true;
     }