summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ConstantFolding.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-10-24 05:22:15 +0000
committerChris Lattner <sabre@nondot.org>2009-10-24 05:22:15 +0000
commit9e2d5b3b8eccc1d88f849b3bddb5bc48c63c754f (patch)
treefa76fb833d53a54c022432f9e84aa492521857e1 /llvm/lib/Analysis/ConstantFolding.cpp
parentd33198420ddad07a08e42730d9e4245bcf7f12a7 (diff)
downloadbcm5719-llvm-9e2d5b3b8eccc1d88f849b3bddb5bc48c63c754f.tar.gz
bcm5719-llvm-9e2d5b3b8eccc1d88f849b3bddb5bc48c63c754f.zip
fix PR5287, a serious regression from my previous patches. Thanks to
Duncan for the nice tiny testcase. llvm-svn: 84992
Diffstat (limited to 'llvm/lib/Analysis/ConstantFolding.cpp')
-rw-r--r--llvm/lib/Analysis/ConstantFolding.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp
index 214caeb92a0..3fe1d754546 100644
--- a/llvm/lib/Analysis/ConstantFolding.cpp
+++ b/llvm/lib/Analysis/ConstantFolding.cpp
@@ -161,6 +161,7 @@ static bool ReadDataFromGlobal(Constant *C, uint64_t ByteOffset,
return true;
// Move to the next element of the struct.
+ CurPtr += NextEltOffset-CurEltOffset-ByteOffset;
BytesLeft -= NextEltOffset-CurEltOffset-ByteOffset;
ByteOffset = 0;
CurEltOffset = NextEltOffset;
OpenPOWER on IntegriCloud