[llvm-commits] [124086] don't dereference a null type-size field.

clattner at apple.com clattner at apple.com
Mon Feb 19 12:15:15 PST 2007


Revision: 124086
Author:   clattner
Date:     2007-02-19 12:15:12 -0800 (Mon, 19 Feb 2007)

Log Message:
-----------
don't dereference a null type-size field.

Modified Paths:
--------------
    apple-local/branches/llvm/gcc/llvm-types.cpp

Modified: apple-local/branches/llvm/gcc/llvm-types.cpp
===================================================================
--- apple-local/branches/llvm/gcc/llvm-types.cpp	2007-02-19 19:51:56 UTC (rev 124085)
+++ apple-local/branches/llvm/gcc/llvm-types.cpp	2007-02-19 20:15:12 UTC (rev 124086)
@@ -212,7 +212,8 @@
 bool isPassedByInvisibleReference(tree Type) {
   // FIXME: Search for TREE_ADDRESSABLE in calls.c, and see if there are other
   // cases that make arguments automatically passed in by reference.
-  return TREE_ADDRESSABLE(Type) || TREE_CODE(TYPE_SIZE(Type)) != INTEGER_CST;
+  return TREE_ADDRESSABLE(Type) || TYPE_SIZE(Type) == 0 ||
+         TREE_CODE(TYPE_SIZE(Type)) != INTEGER_CST;
 }
 
 /// GetTypeName - Return a fully qualified (with namespace prefixes) name for





More information about the llvm-commits mailing list