llvm.org GIT mirror llvm / 285cad0
Don't use potentially invalidated iterator If the lhs is evaluated before the rhs, FuncletI's operator-> can trigger the assert(isHandleInSync() && "invalid iterator access!"); at include/llvm/ADT/DenseMap.h:1061. (Happens e.g. when compiled with GCC 6.) Differential Revision: http://reviews.llvm.org/D18440 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265024 91177308-0d34-0410-b5e6-96231b3b80d8 Stephan Bergmann 4 years ago
1 changed file(s) with 4 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
452452
453453 // Add the new block to the funclet.
454454 const auto &FuncletI = FuncletMembership.find(&CurMBB);
455 if (FuncletI != FuncletMembership.end())
456 FuncletMembership[NewMBB] = FuncletI->second;
455 if (FuncletI != FuncletMembership.end()) {
456 auto n = FuncletI->second;
457 FuncletMembership[NewMBB] = n;
458 }
457459
458460 return NewMBB;
459461 }