aboutsummaryrefslogtreecommitdiff
path: root/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
commitc5af649758ac8c6ffb896d7d5c570640a9fa1dee (patch)
tree1d3361f3c33ef7f0e0af1a65a5ac58b8e44eabf9 /lib/Analysis/ConstantFolding.cpp
parent66284e063a1e46500acae48bdc0e4a00652021d1 (diff)
fix PR5287, a serious regression from my previous patches. Thanks to
Duncan for the nice tiny testcase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84992 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ConstantFolding.cpp')
-rw-r--r--lib/Analysis/ConstantFolding.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Analysis/ConstantFolding.cpp b/lib/Analysis/ConstantFolding.cpp
index 214caeb92a..3fe1d75454 100644
--- a/lib/Analysis/ConstantFolding.cpp
+++ b/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;