aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-12-06 22:18:25 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-12-06 22:18:25 +0000
commit9f9b3acfce893ccfedd89573f24bd363dd15a6ce (patch)
tree70bf131b056bc396070f247198bccf6127c0d5d2
parent441c3cf82b6a63fe7dd2d31766b0ba65d750cda4 (diff)
downloadexternal_llvm-9f9b3acfce893ccfedd89573f24bd363dd15a6ce.zip
external_llvm-9f9b3acfce893ccfedd89573f24bd363dd15a6ce.tar.gz
external_llvm-9f9b3acfce893ccfedd89573f24bd363dd15a6ce.tar.bz2
For PR409: \
Make sure to check isValueValidForType on floating point constants and give \ an error if the value is not valid, otherwise it would assert in the VMCore git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18584 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/AsmParser/llvmAsmParser.y2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y
index 4a4803e..070e978 100644
--- a/lib/AsmParser/llvmAsmParser.y
+++ b/lib/AsmParser/llvmAsmParser.y
@@ -1318,6 +1318,8 @@ ConstVal : SIntType EINT64VAL { // integral constants
$$ = ConstantBool::False;
}
| FPType FPVAL { // Float & Double constants
+ if (!ConstantFP::isValueValidForType($1, $2))
+ ThrowException("Floating point constant invalid for type!!");
$$ = ConstantFP::get($1, $2);
};