aboutsummaryrefslogtreecommitdiffhomepage
path: root/objectivec
diff options
context:
space:
mode:
authorGravatar Thomas Van Lenten <thomasvl@google.com>2018-01-31 13:57:50 -0500
committerGravatar Thomas Van Lenten <thomasvl@google.com>2018-01-31 14:24:51 -0500
commit81aeed082ecc35b62f1808234f4a0dd347775b33 (patch)
tree8fe501639a02b87c17fc6ac0c30ac82568cb0f39 /objectivec
parent953adb16ff2f982d54dd812b51df5fdb392732f8 (diff)
Work around the static analyzer false report.
Diffstat (limited to 'objectivec')
-rw-r--r--objectivec/GPBMessage.m6
1 files changed, 6 insertions, 0 deletions
diff --git a/objectivec/GPBMessage.m b/objectivec/GPBMessage.m
index a9f8bfe7..2e9fd7c6 100644
--- a/objectivec/GPBMessage.m
+++ b/objectivec/GPBMessage.m
@@ -753,6 +753,12 @@ void GPBPrepareReadOnlySemaphore(GPBMessage *self) {
if (!atomic_compare_exchange_strong(&self->readOnlySemaphore_, &expected, worker)) {
dispatch_release(worker);
}
+#if defined(__clang_analyzer__)
+ // The Xcode 9.2 (and 9.3 beta) static analyzer thinks worker is leaked
+ // (doesn't seem to know about atomic_compare_exchange_strong); so just
+ // for the analyzer, let it think worker is also released in this case.
+ else { dispatch_release(worker); }
+#endif
}
#pragma clang diagnostic pop