From af1e4bb28a01abbb980550bd0add8db4f09a8e1d Mon Sep 17 00:00:00 2001 From: Zhengyu Gu Date: Thu, 12 Feb 2026 19:49:23 +0000 Subject: [PATCH] Silent code checker --- ddprof-lib/src/main/cpp/libraryPatcher_linux.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/ddprof-lib/src/main/cpp/libraryPatcher_linux.cpp b/ddprof-lib/src/main/cpp/libraryPatcher_linux.cpp index d8397bd70..793acf166 100644 --- a/ddprof-lib/src/main/cpp/libraryPatcher_linux.cpp +++ b/ddprof-lib/src/main/cpp/libraryPatcher_linux.cpp @@ -88,15 +88,9 @@ void LibraryPatcher::patch_libraries() { void LibraryPatcher::patch_library_unlocked(CodeCache* lib) { char path[PATH_MAX]; char* resolved_path = realpath(lib->name(), path); - if (resolved_path == nullptr) { - // virtual file, e.g. [vdso], etc. - // scan-build false positive: resolved_path is used at line 96 - resolved_path = (char*)lib->name(); - } else { - // Don't patch self - if (strcmp(resolved_path,_profiler_name) == 0) { - return; - } + if (resolved_path != nullptr && // filter out virtual file, e.g. [vdso], etc. + strcmp(resolved_path, _profiler_name) == 0) { // Don't patch self + return; } void** pthread_create_location = (void**)lib->findImport(im_pthread_create);