diff options
author | 2018-06-19 12:29:51 -0700 | |
---|---|---|
committer | 2018-06-19 17:09:45 -0700 | |
commit | e383d23918db4eede30c3d78589d4639de3ec446 (patch) | |
tree | a103f54ec49fac8d5cd15661f5c2d0cb5dab32e5 /runtime/class_loader_utils.h | |
parent | dbf540399a2aaddad00b1233b80808c80dc0d443 (diff) |
ART: Mask garbage-memory warnings
Add invariants or NOLINT to let clang-analyzer understand that
there's no garbage involved.
(The analysis itself is too expensive to force it on for all
local builds.)
Test: mmma art
Change-Id: I6148d743321248195abb3a8f646e63941f11f9a9
Diffstat (limited to 'runtime/class_loader_utils.h')
-rw-r--r-- | runtime/class_loader_utils.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/runtime/class_loader_utils.h b/runtime/class_loader_utils.h index af42878e97..78ad568d25 100644 --- a/runtime/class_loader_utils.h +++ b/runtime/class_loader_utils.h @@ -147,8 +147,14 @@ inline void VisitClassLoaderDexFiles(ScopedObjectAccessAlreadyRunnable& soa, Handle<mirror::ClassLoader> class_loader, Visitor fn) REQUIRES_SHARED(Locks::mutator_lock_) { - auto helper = [&fn](const art::DexFile* dex_file, void** ATTRIBUTE_UNUSED) + auto helper = [&fn](const art::DexFile* dex_file, void** ret) REQUIRES_SHARED(Locks::mutator_lock_) { +#ifdef __clang_analyzer__ + *ret = nullptr; +#else + UNUSED(ret); +#endif + return fn(dex_file); }; VisitClassLoaderDexFiles<decltype(helper), void*>(soa, |