[llvm-commits] [llvm-gcc-4.2] r62348 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Stuart Hastings
stuart at apple.com
Fri Jan 16 11:55:52 PST 2009
Author: stuart
Date: Fri Jan 16 13:55:51 2009
New Revision: 62348
URL: http://llvm.org/viewvc/llvm-project?rev=62348&view=rev
Log:
Apple Radar 6417682
Union constructors can legitimately have an empty initializing vector
if the GCC FE belatedly realizes that any of the initial values are
not constants. Handle a present-but-empty vector just like a
not-present vector.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=62348&r1=62347&r2=62348&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Fri Jan 16 13:55:51 2009
@@ -6444,7 +6444,7 @@
case UNION_TYPE:
// Store each element of the constructor into the corresponding field of
// DEST.
- if (!elt) return 0; // no elements
+ if (!elt || VEC_empty(constructor_elt, elt)) return 0; // no elements
assert(VEC_length(constructor_elt, elt) == 1
&& "Union CONSTRUCTOR should have one element!");
tree tree_purpose = VEC_index(constructor_elt, elt, 0)->index;
More information about the llvm-commits
mailing list