diff options
author | David Blaikie <dblaikie@gmail.com> | 2015-05-21 00:06:38 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2015-05-21 00:06:38 +0000 |
commit | 47ee653cdcb5f8db2ef4cd227c16916b5653c7d2 (patch) | |
tree | 0ea7d2689524664f3958b6da976710a889779108 | |
parent | f12338a6b7bb8a9db315c102c88310748f5212a5 (diff) |
[opaque pointer type] Pass explicit pointee type in another case of GEP constant folding
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237860 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/IR/ConstantFold.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/IR/ConstantFold.cpp b/lib/IR/ConstantFold.cpp index 16b113df1b8..3f64c43e902 100644 --- a/lib/IR/ConstantFold.cpp +++ b/lib/IR/ConstantFold.cpp @@ -2221,7 +2221,7 @@ static Constant *ConstantFoldGetElementPtrImpl(Type *PointeeTy, Constant *C, if (!NewIdxs.empty()) { for (unsigned i = 0, e = Idxs.size(); i != e; ++i) if (!NewIdxs[i]) NewIdxs[i] = cast<Constant>(Idxs[i]); - return ConstantExpr::getGetElementPtr(nullptr, C, NewIdxs, inBounds); + return ConstantExpr::getGetElementPtr(PointeeTy, C, NewIdxs, inBounds); } // If all indices are known integers and normalized, we can do a simple |