From e383d23918db4eede30c3d78589d4639de3ec446 Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Tue, 19 Jun 2018 12:29:51 -0700 Subject: 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 --- runtime/class_loader_utils.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'runtime/class_loader_utils.h') 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 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(soa, -- cgit v1.2.3-59-g8ed1b