aboutsummaryrefslogtreecommitdiffstats
path: root/lib/AsmParser
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-11-28 16:45:45 +0000
committerChris Lattner <sabre@nondot.org>2004-11-28 16:45:45 +0000
commit7891593359420f69422840584b05f0b0c3b7da52 (patch)
tree37335b89bbbb073f7b8ba8c2f658798a18fe21cd /lib/AsmParser
parent2ded5d0053430f44f47899bbf4dbc86df59eb61a (diff)
downloadexternal_llvm-7891593359420f69422840584b05f0b0c3b7da52.zip
external_llvm-7891593359420f69422840584b05f0b0c3b7da52.tar.gz
external_llvm-7891593359420f69422840584b05f0b0c3b7da52.tar.bz2
Fix PR463
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18303 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AsmParser')
-rw-r--r--lib/AsmParser/llvmAsmParser.y5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y
index 1f6b539..4a4803e 100644
--- a/lib/AsmParser/llvmAsmParser.y
+++ b/lib/AsmParser/llvmAsmParser.y
@@ -1294,7 +1294,10 @@ ConstVal: Types '[' ConstVector ']' { // Nonempty unsized arr
delete $1;
}
| Types ZEROINITIALIZER {
- $$ = Constant::getNullValue($1->get());
+ const Type *Ty = $1->get();
+ if (isa<FunctionType>(Ty) || Ty == Type::LabelTy || isa<OpaqueType>(Ty))
+ ThrowException("Cannot create a null initialized value of this type!");
+ $$ = Constant::getNullValue(Ty);
delete $1;
};