[llvm-commits] CVS: llvm/lib/Transforms/ExprTypeConvert.cpp

Alkis Evlogimenos alkis at cs.uiuc.edu
Tue Feb 1 20:43:50 PST 2005



Changes in directory llvm/lib/Transforms:

ExprTypeConvert.cpp updated: 1.102 -> 1.103
---
Log message:

Fix crash on MallocInsts of unsized types.


---
Diffs of the changes:  (+2 -1)

 ExprTypeConvert.cpp |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)


Index: llvm/lib/Transforms/ExprTypeConvert.cpp
diff -u llvm/lib/Transforms/ExprTypeConvert.cpp:1.102 llvm/lib/Transforms/ExprTypeConvert.cpp:1.103
--- llvm/lib/Transforms/ExprTypeConvert.cpp:1.102	Mon Jan 31 19:22:56 2005
+++ llvm/lib/Transforms/ExprTypeConvert.cpp	Tue Feb  1 22:43:37 2005
@@ -47,7 +47,8 @@
 
   // 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());






More information about the llvm-commits mailing list