mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-19 04:29:21 +00:00
Fix crash on MallocInsts of unsized types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19988 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c23d696e71
commit
83874c9571
@ -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