diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2016-06-27 19:43:15 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2016-06-27 19:43:15 +0000 |
commit | 82f41518ed1e24cc1c4f27dc0f35923b76055a99 (patch) | |
tree | 96d00bab6a899aaf75f195a31de98a2cec7eaafc /llvm/lib/IR/Verifier.cpp | |
parent | 4168d758882fe25875503ff5660534e2656455af (diff) | |
download | bcm5719-llvm-82f41518ed1e24cc1c4f27dc0f35923b76055a99.tar.gz bcm5719-llvm-82f41518ed1e24cc1c4f27dc0f35923b76055a99.zip |
Verifier: Reject non-float !fpmath
Code already assumes this is float. getFPAccuracy()
crashes on any other type.
llvm-svn: 273912
Diffstat (limited to 'llvm/lib/IR/Verifier.cpp')
-rw-r--r-- | llvm/lib/IR/Verifier.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
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<ConstantFP>(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 { |