[asan] correctly use ConstantExpr::getGetElementPtr. Catch by NAKAMURA Takumi
authorKostya Serebryany <kcc@google.com>
Sat, 28 Jan 2012 04:27:16 +0000 (04:27 +0000)
committerKostya Serebryany <kcc@google.com>
Sat, 28 Jan 2012 04:27:16 +0000 (04:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149172 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Instrumentation/AddressSanitizer.cpp

index 3f0681517e35843b1874786e2788781369f14ba2..e8fb4d5c47a20e468686dd511655d65bbb210313 100644 (file)
@@ -484,7 +484,7 @@ bool AddressSanitizer::insertGlobalRedzones(Module &M) {
     Indices2[1] = IRB.getInt32(0);
 
     G->replaceAllUsesWith(
-        ConstantExpr::getGetElementPtr(NewGlobal, Indices2, 2));
+        ConstantExpr::getGetElementPtr(NewGlobal, Indices2, true));
     NewGlobal->takeName(G);
     G->eraseFromParent();