forked from OSchip/llvm-project
[msan] Disable assert with msan
The assert uses data from just destroyed BasicBlock.
This commit is contained in:
parent
0d0a99cb96
commit
33c5d8f939
|
@ -24,6 +24,7 @@
|
||||||
#include "llvm/MC/MCSymbol.h"
|
#include "llvm/MC/MCSymbol.h"
|
||||||
#include "llvm/Pass.h"
|
#include "llvm/Pass.h"
|
||||||
#include "llvm/Support/Casting.h"
|
#include "llvm/Support/Casting.h"
|
||||||
|
#include "llvm/Support/Compiler.h"
|
||||||
#include "llvm/Support/ErrorHandling.h"
|
#include "llvm/Support/ErrorHandling.h"
|
||||||
#include "llvm/Target/TargetLoweringObjectFile.h"
|
#include "llvm/Target/TargetLoweringObjectFile.h"
|
||||||
#include "llvm/Target/TargetMachine.h"
|
#include "llvm/Target/TargetMachine.h"
|
||||||
|
@ -145,8 +146,11 @@ void MMIAddrLabelMap::UpdateForDeletedBlock(BasicBlock *BB) {
|
||||||
assert(!Entry.Symbols.empty() && "Didn't have a symbol, why a callback?");
|
assert(!Entry.Symbols.empty() && "Didn't have a symbol, why a callback?");
|
||||||
BBCallbacks[Entry.Index] = nullptr; // Clear the callback.
|
BBCallbacks[Entry.Index] = nullptr; // Clear the callback.
|
||||||
|
|
||||||
|
#if !LLVM_MEMORY_SANITIZER_BUILD
|
||||||
|
// BasicBlock is destroyed already, so this access is UB detectable by msan.
|
||||||
assert((BB->getParent() == nullptr || BB->getParent() == Entry.Fn) &&
|
assert((BB->getParent() == nullptr || BB->getParent() == Entry.Fn) &&
|
||||||
"Block/parent mismatch");
|
"Block/parent mismatch");
|
||||||
|
#endif
|
||||||
|
|
||||||
for (MCSymbol *Sym : Entry.Symbols) {
|
for (MCSymbol *Sym : Entry.Symbols) {
|
||||||
if (Sym->isDefined())
|
if (Sym->isDefined())
|
||||||
|
|
Loading…
Reference in New Issue