Skip to content

Commit 57be0a1

Browse files
jbachorikclaude
andcommitted
Suppress scan-build false positive in walkVM crash protection
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent 15a0068 commit 57be0a1

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,12 @@ __attribute__((no_sanitize("address"))) int StackWalker::walkVM(void* ucontext,
302302
if (anchor == NULL) {
303303
Counters::increment(WALKVM_ANCHOR_NULL);
304304
}
305+
// scan-build false positive: reports "stack address stored into global variable"
306+
// because it cannot model setjmp scoping — the pointer is always restored to
307+
// saved_exception before walkVM returns (longjmp path: line ~313, normal exit: done label).
308+
#ifndef __clang_analyzer__
305309
vm_thread->exception() = &crash_protection_ctx;
310+
#endif
306311
if (profiled_thread != nullptr) {
307312
profiled_thread->setCrashProtectionActive(true);
308313
}

0 commit comments

Comments
 (0)