diff options
| author | George Burgess IV <gbiv@google.com> | 2017-10-02 22:42:19 +0000 |
|---|---|---|
| committer | android-build-merger <android-build-merger@google.com> | 2017-10-02 22:42:19 +0000 |
| commit | 84b998f437ce21ba3d0f98e24bd637610325f69a (patch) | |
| tree | b82676654074bb519012cf9001ef76260f6d2c70 /libutils | |
| parent | 0fdb8616b8e988be380e21586c45b48ee9c3e398 (diff) | |
| parent | 584853bdb04d49a26de1c10683f785d72c8589db (diff) | |
| download | system_core-84b998f437ce21ba3d0f98e24bd637610325f69a.tar.gz system_core-84b998f437ce21ba3d0f98e24bd637610325f69a.tar.bz2 system_core-84b998f437ce21ba3d0f98e24bd637610325f69a.zip | |
Merge "Silence a use-after-free warning from the analyzer" am: 8c853c43cc
am: 584853bdb0
Change-Id: I355b80ad7e59daeba569e6f9bb8eea853121acf9
Diffstat (limited to 'libutils')
| -rw-r--r-- | libutils/RefBase.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libutils/RefBase.cpp b/libutils/RefBase.cpp index 24737b985..f5f881fcc 100644 --- a/libutils/RefBase.cpp +++ b/libutils/RefBase.cpp @@ -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); } |
