Go patch committed: Layout undefined type

Message ID mcr8vzjlzoy.fsf@google.com
State New
Headers show

Commit Message

Ian Taylor Dec. 21, 2010, 6:59 p.m.
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.



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;