projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c23d696
)
Fix crash on MallocInsts of unsized types.
author
Alkis Evlogimenos
<alkis@evlogimenos.com>
Wed, 2 Feb 2005 04:43:37 +0000
(
04:43
+0000)
committer
Alkis Evlogimenos
<alkis@evlogimenos.com>
Wed, 2 Feb 2005 04:43:37 +0000
(
04:43
+0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19988
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Transforms/ExprTypeConvert.cpp
patch
|
blob
|
history
diff --git
a/lib/Transforms/ExprTypeConvert.cpp
b/lib/Transforms/ExprTypeConvert.cpp
index 675ad7b1aa600c3054473da77ddb5fa9087e4cb3..0389daacf775630ee17986948fea0b4d18a56798 100644
(file)
--- a/
lib/Transforms/ExprTypeConvert.cpp
+++ b/
lib/Transforms/ExprTypeConvert.cpp
@@
-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());