Skip to content

Commit

Permalink
[Verifier] Pass raw_ostream as pointer instead of reference
Browse files Browse the repository at this point in the history
This can be nullptr and ubsan found a couple of cases in LLVM's unit
tests.
  • Loading branch information
d0k committed Aug 1, 2023
1 parent 9d927d0 commit 502280e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions llvm/include/llvm/ADT/GenericConvergenceVerifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ template <typename ContextT> class GenericConvergenceVerifier {
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);
}
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/IR/Verifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ class Verifier : public InstVisitor<Verifier>, VerifierSupport {
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.
Expand Down

0 comments on commit 502280e

Please sign in to comment.