diff options
-rw-r--r-- | build/Android.bp | 2 | ||||
-rw-r--r-- | profman/profile_assistant_test.cc | 11 | ||||
-rw-r--r-- | runtime/thread.cc | 2 |
3 files changed, 11 insertions, 4 deletions
diff --git a/build/Android.bp b/build/Android.bp index 434a6581e1..c0323b4a35 100644 --- a/build/Android.bp +++ b/build/Android.bp @@ -36,6 +36,7 @@ art_clang_tidy_errors = [ "bugprone-virtual-near-miss", "misc-unused-using-decls", "modernize-use-bool-literals", + "modernize-use-nullptr", "performance-faster-string-find", "performance-for-range-copy", "performance-implicit-conversion-in-loop", @@ -49,7 +50,6 @@ art_clang_tidy_allowed = [ // when all files are free of these warnings. "android-cloexec-dup", "bugprone-unused-return-value", - "modernize-use-nullptr", "modernize-use-using", // TODO: move to art_clang_tidy_errors after b/236243696 is done ] diff --git a/profman/profile_assistant_test.cc b/profman/profile_assistant_test.cc index 01b385a6c7..4fc8143c6b 100644 --- a/profman/profile_assistant_test.cc +++ b/profman/profile_assistant_test.cc @@ -1840,6 +1840,7 @@ TEST_F(ProfileAssistantTest, MergeProfilesNoProfile) { // Run profman and pass the dex file with --apk-fd. android::base::unique_fd apk_fd( + // NOLINTNEXTLINE - Profman needs file to be opened after fork() and exec() open(GetTestDexFileName("ProfileTestMultiDex").c_str(), O_RDONLY)); ASSERT_GE(apk_fd.get(), 0); @@ -1882,6 +1883,7 @@ TEST_F(ProfileAssistantTest, MergeProfilesNoProfilePassByFilename) { // Run profman and pass the dex file with --apk-fd. android::base::unique_fd apk_fd( + // NOLINTNEXTLINE - Profman needs file to be opened after fork() and exec() open(GetTestDexFileName("ProfileTestMultiDex").c_str(), O_RDONLY)); ASSERT_GE(apk_fd.get(), 0); @@ -1919,6 +1921,7 @@ TEST_F(ProfileAssistantTest, MergeProfilesNoProfileEmptyReferenceProfile) { // Run profman and pass the dex file with --apk-fd. android::base::unique_fd apk_fd( + // NOLINTNEXTLINE - Profman needs file to be opened after fork() and exec() open(GetTestDexFileName("ProfileTestMultiDex").c_str(), O_RDONLY)); ASSERT_GE(apk_fd.get(), 0); @@ -1957,6 +1960,7 @@ TEST_F(ProfileAssistantTest, MergeProfilesNoProfileEmptyReferenceProfileAfterFil // Run profman and pass the real dex file with --apk-fd. android::base::unique_fd apk_fd( + // NOLINTNEXTLINE - Profman needs file to be opened after fork() and exec() open(GetTestDexFileName("ProfileTestMultiDex").c_str(), O_RDONLY)); ASSERT_GE(apk_fd.get(), 0); @@ -2003,7 +2007,8 @@ TEST_F(ProfileAssistantTest, CopyAndUpdateProfileKey) { // Run profman and pass the dex file with --apk-fd. android::base::unique_fd apk_fd( - open(GetTestDexFileName("ProfileTestMultiDex").c_str(), O_RDONLY)); // NOLINT + // NOLINTNEXTLINE - Profman needs file to be opened after fork() and exec() + open(GetTestDexFileName("ProfileTestMultiDex").c_str(), O_RDONLY)); ASSERT_GE(apk_fd.get(), 0); std::string profman_cmd = GetProfmanCmd(); @@ -2050,6 +2055,7 @@ TEST_F(ProfileAssistantTest, CopyAndUpdateProfileKeyNoUpdate) { // Run profman and pass the real dex file with --apk-fd. It won't match any entry in the profile. android::base::unique_fd apk_fd( + // NOLINTNEXTLINE - Profman needs file to be opened after fork() and exec() open(GetTestDexFileName("ProfileTestMultiDex").c_str(), O_RDONLY)); ASSERT_GE(apk_fd.get(), 0); @@ -2171,7 +2177,8 @@ TEST_F(ProfileAssistantTest, BootImageMergeWithAnnotations) { // Run profman and pass the dex file with --apk-fd. android::base::unique_fd apk_fd( - open(GetTestDexFileName("ProfileTestMultiDex").c_str(), O_RDONLY)); // NOLINT + // NOLINTNEXTLINE - Profman needs file to be opened after fork() and exec() + open(GetTestDexFileName("ProfileTestMultiDex").c_str(), O_RDONLY)); ASSERT_GE(apk_fd.get(), 0); std::string profman_cmd = GetProfmanCmd(); diff --git a/runtime/thread.cc b/runtime/thread.cc index 94c539f592..0c146d5bf1 100644 --- a/runtime/thread.cc +++ b/runtime/thread.cc @@ -4000,7 +4000,7 @@ class ReferenceMapVisitor : public StackVisitor { // (PC shall be known thanks to the runtime frame for throwing SIOOBE). // Note that JIT does not emit that intrinic implementation. const void* pc = reinterpret_cast<const void*>(GetCurrentQuickFramePc()); - if (pc != 0u && Runtime::Current()->GetHeap()->IsInBootImageOatFile(pc)) { + if (pc != nullptr && Runtime::Current()->GetHeap()->IsInBootImageOatFile(pc)) { return; } } |