Index: clang/lib/StaticAnalyzer/Core/ExprEngine.cpp =================================================================== --- clang/lib/StaticAnalyzer/Core/ExprEngine.cpp +++ clang/lib/StaticAnalyzer/Core/ExprEngine.cpp @@ -2704,8 +2704,9 @@ // (2) We are binding to a MemRegion that does not have stack storage. // (3) We are binding to a top-level parameter region with a non-trivial // destructor. We won't see the destructor during analysis, but it's there. +// // (4) We are binding to a MemRegion with stack storage that the store -// does not understand. +// does not understand. - We handle it in ExprEngine::VisitBinaryOperator(). ProgramStateRef ExprEngine::processPointerEscapedOnBind( ProgramStateRef State, ArrayRef> LocAndVals, const LocationContext *LCtx, PointerEscapeKind Kind, @@ -2727,17 +2728,6 @@ Escaped.push_back(LocAndVal.second); continue; } - - // Case (4): in order to test that, generate a new state with the binding - // added. If it is the same state, then it escapes (since the store cannot - // represent the binding). - // Do this only if we know that the store is not supposed to generate the - // same state. - SVal StoredVal = State->getSVal(MR); - if (StoredVal != LocAndVal.second) - if (State == - (State->bindLoc(loc::MemRegionVal(MR), LocAndVal.second, LCtx))) - Escaped.push_back(LocAndVal.second); } if (Escaped.empty()) Index: clang/test/Analysis/temporaries-callback-order.cpp =================================================================== --- clang/test/Analysis/temporaries-callback-order.cpp +++ clang/test/Analysis/temporaries-callback-order.cpp @@ -14,14 +14,12 @@ void seeIfCheckBindWorks() { // This should trigger checkBind. The rest of the code shouldn't. - // This also triggers checkRegionChanges after that. // Note that this function is analyzed first, so the messages would be on top. int x = 1; } // seeIfCheckBindWorks(): // CHECK: Bind -// CHECK-NEXT: RegionChanges // testTemporaries(): // CHECK-NEXT: RegionChanges