Merge "Silence a use-after-free warning from the analyzer"

am: 8c853c43cc

Change-Id: I053089d33c2e46da12c6e8d72252fd73bea0debf
This commit is contained in:
George Burgess IV 2017-10-02 22:40:42 +00:00 committed by android-build-merger
commit 584853bdb0
1 changed files with 5 additions and 0 deletions

View File

@ -442,6 +442,11 @@ void RefBase::decStrong(const void* id) const
// and all accesses to refs happen before its deletion in the final decWeak.
// The destructor can safely access mRefs because either it's deleting
// mRefs itself, or it's running entirely before the final mWeak decrement.
//
// Since we're doing atomic loads of `flags`, the static analyzer assumes
// they can change between `delete this;` and `refs->decWeak(id);`. This is
// not the case. The analyzer may become more okay with this patten when
// https://bugs.llvm.org/show_bug.cgi?id=34365 gets resolved. NOLINTNEXTLINE
refs->decWeak(id);
}