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 | 5bf00893b68f06cd6112c51d0df676ec8ba2460f (patch) | |
tree | 0499c2aff8783560c8f86034df3ddb307552b1b1 /llvm/lib/VMCore/ConstantFold.cpp | |
parent | 0bddac16a8c5798df1528ccf43da92a392a488be (diff) | |
download | bcm5719-llvm-5bf00893b68f06cd6112c51d0df676ec8ba2460f.tar.gz bcm5719-llvm-5bf00893b68f06cd6112c51d0df676ec8ba2460f.zip |
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.
llvm-svn: 65383
Diffstat (limited to 'llvm/lib/VMCore/ConstantFold.cpp')
-rw-r--r-- | llvm/lib/VMCore/ConstantFold.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/VMCore/ConstantFold.cpp b/llvm/lib/VMCore/ConstantFold.cpp index ff4d897e54a..f2847112afc 100644 --- a/llvm/lib/VMCore/ConstantFold.cpp +++ b/llvm/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()); |