[llvm-commits] CVS: llvm-gcc/gcc/llvm-types.c

Chris Lattner lattner at cs.uiuc.edu
Thu Jul 28 15:03:04 PDT 2005



Changes in directory llvm-gcc/gcc:

llvm-types.c updated: 1.26 -> 1.27
---
Log message:

Do not crash on variable sized structures.  This fixes
CFrontend/2004-11-27-VariableSizeInStructure.c which Reid noticed was
failing


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

 llvm-types.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm-gcc/gcc/llvm-types.c
diff -u llvm-gcc/gcc/llvm-types.c:1.26 llvm-gcc/gcc/llvm-types.c:1.27
--- llvm-gcc/gcc/llvm-types.c:1.26	Thu Jul 28 13:50:28 2005
+++ llvm-gcc/gcc/llvm-types.c	Thu Jul 28 17:02:53 2005
@@ -1467,7 +1467,7 @@
      * elements so that the LLVM code will have the right size for the
      * structure.
      */
-    {
+    if (TYPE_SIZE(type) && TREE_CODE(TYPE_SIZE(type)) == INTEGER_CST) {
       unsigned GCCTypeSize = ((unsigned)TREE_INT_CST_LOW(TYPE_SIZE(type))+7)/8;
       unsigned LLVMTypeSize, LLVMStructAlign = 1, i;
       






More information about the llvm-commits mailing list