mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-09 05:13:01 +00:00
Fix crash on MallocInsts of unsized types.
llvm-svn: 19988
This commit is contained in:
parent
a856b4db61
commit
3521fcb18f
@ -47,7 +47,8 @@ static bool MallocConvertibleToType(MallocInst *MI, const Type *Ty,
|
||||
|
||||
// Deal with the type to allocate, not the pointer type...
|
||||
Ty = cast<PointerType>(Ty)->getElementType();
|
||||
if (!Ty->isSized()) return false; // Can only alloc something with a size
|
||||
if (!Ty->isSized() || !MI->getType()->getElementType()->isSized())
|
||||
return false; // Can only alloc something with a size
|
||||
|
||||
// Analyze the number of bytes allocated...
|
||||
ExprType Expr = ClassifyExpr(MI->getArraySize());
|
||||
|
Loading…
Reference in New Issue
Block a user