From 82f41518ed1e24cc1c4f27dc0f35923b76055a99 Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Mon, 27 Jun 2016 19:43:15 +0000 Subject: Verifier: Reject non-float !fpmath Code already assumes this is float. getFPAccuracy() crashes on any other type. llvm-svn: 273912 --- llvm/lib/IR/Verifier.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'llvm/lib/IR/Verifier.cpp') diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp index cd8e3093ea7..47ded3cbd42 100644 --- a/llvm/lib/IR/Verifier.cpp +++ b/llvm/lib/IR/Verifier.cpp @@ -3668,6 +3668,8 @@ void Verifier::visitInstruction(Instruction &I) { if (ConstantFP *CFP0 = mdconst::dyn_extract_or_null(MD->getOperand(0))) { const APFloat &Accuracy = CFP0->getValueAPF(); + Assert(&Accuracy.getSemantics() == &APFloat::IEEEsingle, + "fpmath accuracy must have float type", &I); Assert(Accuracy.isFiniteNonZero() && !Accuracy.isNegative(), "fpmath accuracy not a positive number!", &I); } else { -- cgit v1.2.3