mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-18 09:09:12 +00:00
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 ^ llvm-svn: 61681
This commit is contained in:
parent
6488ba2b78
commit
6bbcc64cc0
@ -1906,6 +1906,9 @@ bool LLParser::ConvertGlobalValIDToValue(const Type *Ty, ValID &ID,
|
||||
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 @@ bool LLParser::ConvertGlobalValIDToValue(const Type *Ty, ValID &ID,
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user