From 9e2d5b3b8eccc1d88f849b3bddb5bc48c63c754f Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 24 Oct 2009 05:22:15 +0000 Subject: fix PR5287, a serious regression from my previous patches. Thanks to Duncan for the nice tiny testcase. llvm-svn: 84992 --- llvm/lib/Analysis/ConstantFolding.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'llvm/lib/Analysis/ConstantFolding.cpp') 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; -- cgit v1.2.3