================
@@ -532,15 +533,18 @@ void PthreadLockChecker::ReleaseLockAux(const CallEvent 
&Call,
   LockSetTy LS = state->get<LockSet>();
 
   if (!LS.isEmpty()) {
-    const MemRegion *firstLockR = LS.getHead();
-    if (firstLockR != lockR) {
+    if (WarnOnLockOrderReversal && LS.getHead() != lockR) {
       reportBug(C, BT_lor, MtxExpr, CheckKind,
                 "This was not the most recently acquired lock. Possible lock "
                 "order reversal");
       return;
     }
-    // Record that the lock was released.
-    state = state->set<LockSet>(LS.getTail());
+    auto &Factory = state->get_context<LockSet>();
+    llvm::ImmutableList<const MemRegion *> NewLS = Factory.getEmptyList();
+    for (auto I = LS.begin(), E = LS.end(); I != E; ++I)
----------------
gamesh411 wrote:

Thanks for enabling the range-algo usage of ImmutableList, using that here with 
the latest state of the patch.

https://github.com/llvm/llvm-project/pull/202452
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to