From 18ef4a4a0dd565ba267ee0708c7be3c742b2765a Mon Sep 17 00:00:00 2001 From: Guillaume Chatelet Date: Mon, 22 Oct 2018 15:06:10 +0000 Subject: [PATCH] [llvm-exegesis] Crash when assembling invalid Operand llvm-svn: 344907 --- llvm/tools/llvm-exegesis/lib/Assembler.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/llvm/tools/llvm-exegesis/lib/Assembler.cpp b/llvm/tools/llvm-exegesis/lib/Assembler.cpp index 527b10146a37..1576cfe58e0c 100644 --- a/llvm/tools/llvm-exegesis/lib/Assembler.cpp +++ b/llvm/tools/llvm-exegesis/lib/Assembler.cpp @@ -110,6 +110,8 @@ static void fillMachineFunction(llvm::MachineFunction &MF, Builder.addReg(Op.getReg(), Flags); } else if (Op.isImm()) { Builder.addImm(Op.getImm()); + } else if (!Op.isValid()) { + llvm_unreachable("Operand is not set"); } else { llvm_unreachable("Not yet implemented"); }