1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

[MachineVerifier] Avoid reference to nullptr

Instantiation of the MachineVerifierPass through
PassInfo::getNormalCtor would yield a segfault since the default
constructor of the MachineVerifierPass takes a reference to nullptr.

Patch by Simone Pellegrini.

Differential Revision: https://reviews.llvm.org/D31387

llvm-svn: 298987
This commit is contained in:
Sven van Haastregt 2017-03-29 09:08:25 +00:00
parent 24af11b88f
commit e9a9d299ab

View File

@ -260,8 +260,8 @@ namespace {
static char ID; // Pass ID, replacement for typeid
const std::string Banner;
MachineVerifierPass(const std::string &banner = nullptr)
: MachineFunctionPass(ID), Banner(banner) {
MachineVerifierPass(const std::string banner = std::string())
: MachineFunctionPass(ID), Banner(std::move(banner)) {
initializeMachineVerifierPassPass(*PassRegistry::getPassRegistry());
}