[llvm-commits] [llvm] r61681 - /llvm/trunk/lib/AsmParser/LLParser.cpp
Chris Lattner
sabre at nondot.org
Mon Jan 5 00:13:38 PST 2009
Author: lattner
Date: Mon Jan 5 02:13:38 2009
New Revision: 61681
URL: http://llvm.org/viewvc/llvm-project?rev=61681&view=rev
Log:
reject undef/zero labels. This fixes PR3281:crash0[56].ll with these
diagnostics:
llvm-as: crash05.ll:1:14: invalid type for null constant
global label zeroinitializer addrspace (75), section "c"
^
llvm-as: crash06.ll:2:14: invalid type for null constant
udiv label zeroinitializer, @0
^
Modified:
llvm/trunk/lib/AsmParser/LLParser.cpp
Modified: llvm/trunk/lib/AsmParser/LLParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=61681&r1=61680&r2=61681&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Mon Jan 5 02:13:38 2009
@@ -1906,6 +1906,9 @@
V = ConstantPointerNull::get(cast<PointerType>(Ty));
return false;
case ValID::t_Undef:
+ // FIXME: LabelTy should not be a first-class type.
+ if (!Ty->isFirstClassType() || Ty == Type::LabelTy)
+ return Error(ID.Loc, "invalid type for undef constant");
V = UndefValue::get(Ty);
return false;
case ValID::t_EmptyArray:
@@ -1914,7 +1917,8 @@
V = UndefValue::get(Ty);
return false;
case ValID::t_Zero:
- if (!Ty->isFirstClassType())
+ // FIXME: LabelTy should not be a first-class type.
+ if (!Ty->isFirstClassType() || Ty == Type::LabelTy)
return Error(ID.Loc, "invalid type for null constant");
V = Constant::getNullValue(Ty);
return false;
More information about the llvm-commits
mailing list