NoQ added a comment. I think there's still this problem i've outlined in the comment above: you can step into an integer-underflow if your analysis begins with unlock(). You could just ignore all unlocks that move you below 0, which would be ok.
Could you add this test? std::mutex m; void foo() { m.unlock(); // MutexCount = 4294967295, should be 0, just ignore this unlock. sleep(1); // no-warning m.lock(); // MutexCount = 0, should be 1, woohoo we're sure we're in the section now. // What's the current mutex count? sleep(1); // expected-warning{{}} } Repository: rL LLVM https://reviews.llvm.org/D21506 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits