Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions cpp2rust/cpp2rust.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@

#include "cpp2rust_lib.h"

// LLVM's BumpPtrAllocator intentionally poisons freed slab memory via
// __asan_poison_memory_region. When ASan is enabled this can produce
// use-after-poison false positives inside clang/LLVM itself (e.g. during
// IdentifierTable initialisation). Opting out of user-poisoning suppresses
// those LLVM-internal false positives without affecting real UAF detection.
#if defined(__has_feature) && __has_feature(address_sanitizer)
extern "C" const char *__asan_default_options() {
return "allow_user_poisoning=0";
}
#endif

namespace fs = std::filesystem;

namespace {
Expand Down