projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2defb11
)
compiler: fix method finalization of unnamed structs.
author
Ian Lance Taylor
<ian@gcc.gnu.org>
Wed, 28 Mar 2012 22:21:57 +0000
(22:21 +0000)
committer
Ian Lance Taylor
<ian@gcc.gnu.org>
Wed, 28 Mar 2012 22:21:57 +0000
(22:21 +0000)
Used to trigger an ICE on
var v struct{I}; type I interface{}
Updates issue 7.
From-SVN: r185931
gcc/go/gofrontend/gogo.cc
patch
|
blob
|
history
diff --git
a/gcc/go/gofrontend/gogo.cc
b/gcc/go/gofrontend/gogo.cc
index 5fe5aead9c0aad556894fa4c4c9e3840195891d2..ee68b69cc976079c881865c00859413b071ab07c 100644
(file)
--- a/
gcc/go/gofrontend/gogo.cc
+++ b/
gcc/go/gofrontend/gogo.cc
@@
-1653,8
+1653,12
@@
Finalize_methods::type(Type* t)
}
case Type::TYPE_STRUCT:
+ // Traverse the field types first in case there is an embedded
+ // field with methods that the struct should inherit.
+ if (t->struct_type()->traverse_field_types(this) == TRAVERSE_EXIT)
+ return TRAVERSE_EXIT;
t->struct_type()->finalize_methods(this->gogo_);
-
break
;
+
return TRAVERSE_SKIP_COMPONENTS
;
default:
break;