Skip to content

Commit 16e60e1

Browse files
authored
Silent code checker (#367)
1 parent f71ea60 commit 16e60e1

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

ddprof-lib/src/main/cpp/libraryPatcher_linux.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,9 @@ void LibraryPatcher::patch_libraries() {
8888
void LibraryPatcher::patch_library_unlocked(CodeCache* lib) {
8989
char path[PATH_MAX];
9090
char* resolved_path = realpath(lib->name(), path);
91-
if (resolved_path == nullptr) {
92-
// virtual file, e.g. [vdso], etc.
93-
// scan-build false positive: resolved_path is used at line 96
94-
resolved_path = (char*)lib->name();
95-
} else {
96-
// Don't patch self
97-
if (strcmp(resolved_path,_profiler_name) == 0) {
98-
return;
99-
}
91+
if (resolved_path != nullptr && // filter out virtual file, e.g. [vdso], etc.
92+
strcmp(resolved_path, _profiler_name) == 0) { // Don't patch self
93+
return;
10094
}
10195

10296
void** pthread_create_location = (void**)lib->findImport(im_pthread_create);

0 commit comments

Comments
 (0)