Commit 7b8e0861 authored by Daniel Morsing's avatar Daniel Morsing

cmd/gc: disable inlining of method values

They caused internal compiler errors and they're expensive enough that inlining them doesn't make sense.

Fixes #5259.

R=golang-dev, r, iant, remyoudompheng
CC=golang-dev
https://golang.org/cl/8636043
parent 968732b6
...@@ -188,6 +188,7 @@ ishairy(Node *n, int *budget) ...@@ -188,6 +188,7 @@ ishairy(Node *n, int *budget)
break; break;
case OCLOSURE: case OCLOSURE:
case OCALLPART:
case ORANGE: case ORANGE:
case OFOR: case OFOR:
case OSELECT: case OSELECT:
......
// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package bug
type S struct {
F func()
}
type X interface {
Bar()
}
func Foo(x X) *S {
return &S{F: x.Bar}
}
// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import "./bug"
type foo int
func (f *foo) Bar() {
}
func main() {
bug.Foo(new(foo))
}
// compiledir
// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Issue 5259: Inlining of method value causes internal compiler error
package ignored
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment