You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've encountered an use-after-poison issue, while generating header using my own .td file and llvm::TableGenMain.
The below is the reduced input.
#include"llvm/Support/Allocator.h"
#include"llvm/TableGen/Record.h"namespacedummy_ns {
// unused functionautodummy_allocate(llvm::BumpPtrAllocator &allocator) {
return allocator.Allocate(1, 16);
}
} // namespace dummy_nsintmain() {
llvm::RecordKeeper records;
auto foo = llvm::StringInit::get(records, "foo");
auto bar = llvm::StringInit::get(records, "bar");
}
compiled with clang++ main.cc -lLLVMTableGen -lLLVMSupport -lLLVMDemangle -fsanitize=address -fno-rtti
The second StringInit::get causes use-after-poison.
Even though dummy_allocate is unused, the error is gone when I remove that function.
is this just false-positive?
Tested with libLLVM built in Release build, with sanitizer disabled.