================
@@ -7434,6 +7434,27 @@ void testPointerAliasEscapeAndReset(Foo *f) {
ptr->mu.Unlock();
}
+// A function that may do anything to the objects referred to by the inputs.
+void escapeAliasMultiple(void *, void *, void *);
+void testPointerAliasEscapeMultiple(Foo *F)
+{
+ Foo *L;
+ F->mu.Lock(); // expected-note{{mutex acquired here}}
+ Foo *Fp = F;
+ escapeAliasMultiple(&L, &L, &Fp);
+ Fp->mu.Unlock(); // expected-warning{{releasing mutex 'Fp->mu' that was
not held}}
+} // expected-warning{{mutex 'F->mu' is still held at the end of function}}
+
+void unlockFooWithEscapablePointer(Foo **Fp)
__attribute__((release_capability((*Fp)->mu)));
----------------
melver wrote:
```suggestion
void unlockFooWithEscapablePointer(Foo **Fp)
EXCLUSIVE_UNLOCK_FUNCTION((*Fp)->mu);
```
https://github.com/llvm/llvm-project/pull/178952
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits