diff options
author | Daniel Morsing <daniel.morsing@gmail.com> | 2012-11-06 20:40:40 +0100 |
---|---|---|
committer | Daniel Morsing <daniel.morsing@gmail.com> | 2012-11-06 20:40:40 +0100 |
commit | 38949db99daa4664a56c1b3214df9d7b8d0d13d0 (patch) | |
tree | 22dfebfa680c6845bb1d1b3f2968d7f8f41edc63 /src/cmd/gc/builtin.c | |
parent | b5ca7687e6796cfb9bd57b9f93ba04d4fe3500f3 (diff) | |
download | go-38949db99daa4664a56c1b3214df9d7b8d0d13d0.tar.gz |
cmd/gc, runtime: avoid unnecessary copy on type assertion.
When the first result of a type assertion is blank, the compiler would still copy out a potentially large non-interface type.
Fixes issue 1021.
R=golang-dev, bradfitz, rsc
CC=golang-dev
http://codereview.appspot.com/6812079
Diffstat (limited to 'src/cmd/gc/builtin.c')
-rw-r--r-- | src/cmd/gc/builtin.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/cmd/gc/builtin.c b/src/cmd/gc/builtin.c index d993bc7fc..fc9959738 100644 --- a/src/cmd/gc/builtin.c +++ b/src/cmd/gc/builtin.c @@ -54,6 +54,8 @@ char *runtimeimport = "func @\"\".assertI2I2(@\"\".typ *byte, @\"\".iface any) (@\"\".ret any, @\"\".ok bool)\n" "func @\"\".assertI2T(@\"\".typ *byte, @\"\".iface any) (@\"\".ret any)\n" "func @\"\".assertI2T2(@\"\".typ *byte, @\"\".iface any) (@\"\".ret any, @\"\".ok bool)\n" + "func @\"\".assertI2TOK(@\"\".typ *byte, @\"\".iface any) (@\"\".ok bool)\n" + "func @\"\".assertE2TOK(@\"\".typ *byte, @\"\".iface any) (@\"\".ok bool)\n" "func @\"\".ifaceeq(@\"\".i1 any, @\"\".i2 any) (@\"\".ret bool)\n" "func @\"\".efaceeq(@\"\".i1 any, @\"\".i2 any) (@\"\".ret bool)\n" "func @\"\".ifacethash(@\"\".i1 any) (@\"\".ret uint32)\n" |