From: Alkis Evlogimenos Date: Fri, 27 Feb 2004 01:52:34 +0000 (+0000) Subject: Fix crash caused by passing register 0 to X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=ddcfd9e6fafdbbe5c973477e537119e73c115ee4;p=oota-llvm.git Fix crash caused by passing register 0 to MRegisterInfo::isPhysicalRegister(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11894 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp index 030cb7ef0cf..1e77988be5d 100644 --- a/lib/CodeGen/MachineInstr.cpp +++ b/lib/CodeGen/MachineInstr.cpp @@ -199,7 +199,7 @@ static inline std::ostream& OutputValue(std::ostream &os, const Value* val) { static inline void OutputReg(std::ostream &os, unsigned RegNo, const MRegisterInfo *MRI = 0) { - if (MRegisterInfo::isPhysicalRegister(RegNo)) { + if (!RegNo || MRegisterInfo::isPhysicalRegister(RegNo)) { if (MRI) os << "%" << MRI->get(RegNo).Name; else