summaryrefslogtreecommitdiff
path: root/gcc/go
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2015-07-23 19:57:22 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2015-07-23 19:57:22 +0000
commitbf65976b2545c3ef1c518396273dda559903ebc5 (patch)
tree920912335e30f142ac01bae36115e40490d5f0bf /gcc/go
parent7661d702e0d198c7e7fcbce0edeef8f2f0b1a459 (diff)
downloadgcc-bf65976b2545c3ef1c518396273dda559903ebc5.tar.gz
compiler: Make empty interface types for vars during parse time.
When making the type for a variable with an empty interface type, the parser makes an interface type with a NULL method set and relies on later passes to correct this. For sink variables, which are ignored in later passes, the interface method table is never finalized and a compile time assertion is issued. Instead, the initial type generated by the parser should be the empty interface type. Fixes golang/go#11579. Reviewed-on: https://go-review.googlesource.com/12049 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@226123 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/go')
-rw-r--r--gcc/go/gofrontend/MERGE2
-rw-r--r--gcc/go/gofrontend/parse.cc6
2 files changed, 6 insertions, 2 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index f189ed8ad92..a7b5246ad39 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-b4a932b4a51b612cadcec93a83f94d6ee7d7d190
+cbb27e8089e11094a20502e53ef69c9c36955f85
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
diff --git a/gcc/go/gofrontend/parse.cc b/gcc/go/gofrontend/parse.cc
index 970e6bdd14a..113371c7b21 100644
--- a/gcc/go/gofrontend/parse.cc
+++ b/gcc/go/gofrontend/parse.cc
@@ -1225,7 +1225,11 @@ Parse::interface_type(bool record)
methods = NULL;
}
- Interface_type* ret = Type::make_interface_type(methods, location);
+ Interface_type* ret;
+ if (methods == NULL)
+ ret = Type::make_empty_interface_type(location);
+ else
+ ret = Type::make_interface_type(methods, location);
if (record)
this->gogo_->record_interface_type(ret);
return ret;