diff --git a/lib/CodeGen/AsmPrinter/Win64Exception.cpp b/lib/CodeGen/AsmPrinter/Win64Exception.cpp index 567e0651e34..80edc405ca9 100644 --- a/lib/CodeGen/AsmPrinter/Win64Exception.cpp +++ b/lib/CodeGen/AsmPrinter/Win64Exception.cpp @@ -106,7 +106,7 @@ void Win64Exception::endFunction(const MachineFunction *) { // Emit the tables appropriate to the personality function in use. If we // don't recognize the personality, assume it uses an Itanium-style LSDA. const Function *Per = MMI->getPersonality(); - if (Per->getName() == "__C_specific_handler") + if (Per && Per->getName() == "__C_specific_handler") emitCSpecificHandlerTable(); else emitExceptionTable();