diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-02-24 19:10:46 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-02-24 19:10:46 +0000 |
commit | a7b42034fcd0814572547637fc808587ae0822da (patch) | |
tree | f0fc877e435b1af7585d4e7354d45df264062b0e /lib | |
parent | 46bdfb0e6bb9de86b19562fc52fddefd7014cf73 (diff) | |
download | llvm-a7b42034fcd0814572547637fc808587ae0822da.tar.gz llvm-a7b42034fcd0814572547637fc808587ae0822da.tar.bz2 llvm-a7b42034fcd0814572547637fc808587ae0822da.tar.xz |
Extension of GEP in constant folder was broken (apparently this code
has never been run!).
- Sorry, don't know how to make an LLVM test case for this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65383 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VMCore/ConstantFold.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/VMCore/ConstantFold.cpp b/lib/VMCore/ConstantFold.cpp index ff4d897e54..f2847112af 100644 --- a/lib/VMCore/ConstantFold.cpp +++ b/lib/VMCore/ConstantFold.cpp @@ -1664,7 +1664,7 @@ Constant *llvm::ConstantFoldGetElementPtr(const Constant *C, Offset = ConstantExpr::getSExt(Offset, Base->getType()); else if (Base->getType()->getPrimitiveSizeInBits() < Offset->getType()->getPrimitiveSizeInBits()) - Base = ConstantExpr::getZExt(Base, Base->getType()); + Base = ConstantExpr::getZExt(Base, Offset->getType()); Base = ConstantExpr::getAdd(Base, Offset); return ConstantExpr::getIntToPtr(Base, CE->getType()); |