diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2023-08-01 10:44:28 +0200 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2023-08-01 10:44:28 +0200 |
commit | 502280ed3561e76443ac58e634d3d6468224dd48 (patch) | |
tree | 949135b3c52f5a1769db197d487cc325f664e632 /llvm | |
parent | 9d927d039728edb9a4c26d9f5eeaa9becda89600 (diff) | |
download | llvm-502280ed3561e76443ac58e634d3d6468224dd48.zip llvm-502280ed3561e76443ac58e634d3d6468224dd48.tar.gz llvm-502280ed3561e76443ac58e634d3d6468224dd48.tar.bz2 |
[Verifier] Pass raw_ostream as pointer instead of reference
This can be nullptr and ubsan found a couple of cases in LLVM's unit
tests.
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/include/llvm/ADT/GenericConvergenceVerifier.h | 4 | ||||
-rw-r--r-- | llvm/lib/IR/Verifier.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/llvm/include/llvm/ADT/GenericConvergenceVerifier.h b/llvm/include/llvm/ADT/GenericConvergenceVerifier.h index 213d775..ae5e9e8 100644 --- a/llvm/include/llvm/ADT/GenericConvergenceVerifier.h +++ b/llvm/include/llvm/ADT/GenericConvergenceVerifier.h @@ -30,11 +30,11 @@ public: using CycleInfoT = GenericCycleInfo<ContextT>; using CycleT = typename CycleInfoT::CycleT; - void initialize(raw_ostream &OS, + void initialize(raw_ostream *OS, function_ref<void(const Twine &Message)> FailureCB, const FunctionT &F) { clear(); - this->OS = &OS; + this->OS = OS; this->FailureCB = FailureCB; Context = ContextT(&F); } diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp index e03e6a1..2374aeb 100644 --- a/llvm/lib/IR/Verifier.cpp +++ b/llvm/lib/IR/Verifier.cpp @@ -408,7 +408,7 @@ public: auto FailureCB = [this](const Twine &Message) { this->CheckFailed(Message); }; - CV.initialize(*OS, FailureCB, F); + CV.initialize(OS, FailureCB, F); Broken = false; // FIXME: We strip const here because the inst visitor strips const. |