This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Go patch committed: Layout undefined type
- From: Ian Lance Taylor <iant at google dot com>
- To: gcc-patches at gcc dot gnu dot org, gofrontend-dev at googlegroups dot com
- Date: Tue, 21 Dec 2010 10:59:25 -0800
- Subject: Go patch committed: Layout undefined type
In the Go frontend I forgot to actually layout an empty struct
representing an undefined type. This caused a crash in some code which
expected TYPE_SIZE_UNIT to be valid. This patch fixes the problem.
Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu.
Committed to mainline.
Ian
diff -r 1e7383629b34 go/types.cc
--- a/go/types.cc Tue Dec 21 10:50:54 2010 -0800
+++ b/go/types.cc Tue Dec 21 10:56:00 2010 -0800
@@ -8061,6 +8061,7 @@
tree id = no->get_id(gogo);
tree decl = build_decl(no->location(), TYPE_DECL, id, type_tree);
TYPE_NAME(type_tree) = decl;
+ layout_type(type_tree);
return type_tree;
}