From a2fb234b04eb632fb23aff72e56fd3962aa56e65 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 10 Apr 2010 18:19:22 +0000 Subject: fix PR6760, a missing check in heap SRoA. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100936 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/IPO/GlobalOpt.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/Transforms/IPO/GlobalOpt.cpp') diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp index b01220e375..f5f9e5d9bc 100644 --- a/lib/Transforms/IPO/GlobalOpt.cpp +++ b/lib/Transforms/IPO/GlobalOpt.cpp @@ -966,7 +966,8 @@ static bool ValueIsOnlyUsedLocallyOrStoredToOneGlobal(const Instruction *V, continue; // Otherwise, storing through it, or storing into GV... fine. } - if (isa(Inst)) { + // Must index into the array and into the struct. + if (isa(Inst) && Inst->getNumOperands() >= 3) { if (!ValueIsOnlyUsedLocallyOrStoredToOneGlobal(Inst, GV, PHIs)) return false; continue; -- cgit v1.2.3-70-g09d2