diff options
author | Chris Lattner <sabre@nondot.org> | 2009-11-04 18:57:42 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-11-04 18:57:42 +0000 |
commit | 0fb7e18edd49f8df705a27e789eb925e18d4f44e (patch) | |
tree | e487075e216f59f6cc954934df0fde4e3d66bc6d /lib/Transforms/Scalar/SCCP.cpp | |
parent | 17fc13f00a7eed83cb8259c0594403fcae7fb492 (diff) |
Fix an iterator invalidation bug that happens when a hashtable
resizes in IPSCCP. This fixes PR5394.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86036 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/SCCP.cpp')
-rw-r--r-- | lib/Transforms/Scalar/SCCP.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp index 05a0eeef2d..d515c130e9 100644 --- a/lib/Transforms/Scalar/SCCP.cpp +++ b/lib/Transforms/Scalar/SCCP.cpp @@ -1280,9 +1280,10 @@ CallOverdefined: } if (const StructType *STy = dyn_cast<StructType>(AI->getType())) { - for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) - mergeInValue(getStructValueState(AI, i), AI, - getStructValueState(*CAI, i)); + for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) { + LatticeVal CallArg = getStructValueState(*CAI, i); + mergeInValue(getStructValueState(AI, i), AI, CallArg); + } } else { mergeInValue(AI, getValueState(*CAI)); } |