mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
Fix bug: Assember2003-04-15-ConstantInitAssertion.llx
llvm-svn: 5777
This commit is contained in:
parent
9ae20ce596
commit
f5ce9b1a74
@ -919,8 +919,15 @@ ConstVal: Types '[' ConstVector ']' { // Nonempty unsized arr
|
||||
if (STy == 0)
|
||||
ThrowException("Cannot make struct constant with type: '" +
|
||||
(*$1)->getDescription() + "'!");
|
||||
// FIXME: TODO: Check to see that the constants are compatible with the type
|
||||
// initializer!
|
||||
|
||||
// Check to ensure that constants are compatible with the type initializer!
|
||||
for (unsigned i = 0, e = $3->size(); i != e; ++i)
|
||||
if ((*$3)[i]->getType() != STy->getElementTypes()[i])
|
||||
ThrowException("Expected type '" +
|
||||
STy->getElementTypes()[i]->getDescription() +
|
||||
"' for element #" + utostr(i) +
|
||||
" of structure initializer!");
|
||||
|
||||
$$ = ConstantStruct::get(STy, *$3);
|
||||
delete $1; delete $3;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user