[llvm-branch-commits] [llvm-gcc-branch] r103105 - /llvm-gcc-4.2/branches/Apple/Morbo/gcc/c-typeck.c
Bill Wendling
isanbard at gmail.com
Wed May 5 11:30:28 PDT 2010
Author: void
Date: Wed May 5 13:30:28 2010
New Revision: 103105
URL: http://llvm.org/viewvc/llvm-project?rev=103105&view=rev
Log:
$ svn merge -c 102957 https://llvm.org/svn/llvm-project/llvm-gcc-4.2/trunk
Modified:
llvm-gcc-4.2/branches/Apple/Morbo/gcc/c-typeck.c
Modified: llvm-gcc-4.2/branches/Apple/Morbo/gcc/c-typeck.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Morbo/gcc/c-typeck.c?rev=103105&r1=103104&r2=103105&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Morbo/gcc/c-typeck.c (original)
+++ llvm-gcc-4.2/branches/Apple/Morbo/gcc/c-typeck.c Wed May 5 13:30:28 2010
@@ -2129,6 +2129,14 @@
|| TREE_CODE(ty) == QUAL_UNION_TYPE)
ty = TYPE_MAIN_VARIANT (ty);
+ if (TYPE_SIZE_UNIT (ty) == 0) {
+ /* We don't know the size of the array elements, so we can't
+ index it. Invoke the usual GCC routine; it will diagnose
+ the error and return a tree that won't ICE. */
+ return build_indirect_ref (build_binary_op (PLUS_EXPR, ar, index, 0),
+ "array indexing");
+ }
+
ar = build4 (ARRAY_REF, ty, ar, index, NULL_TREE, NULL_TREE);
/* Mirror logic from build_indirect_ref to set TREE_THIS_VOLATILE and
* other flags.
More information about the llvm-branch-commits
mailing list