Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal compiler error: walkexpr: switch 1 unknown op CALL #1990

Closed
edsrzf opened this issue Jun 22, 2011 · 4 comments
Closed

internal compiler error: walkexpr: switch 1 unknown op CALL #1990

edsrzf opened this issue Jun 22, 2011 · 4 comments

Comments

@edsrzf
Copy link

edsrzf commented Jun 22, 2011

1. What is a short input program that triggers the error?
package main

var r = f()

func main() {
    r.m()
}

2. What is the full compiler output?
walk [9738f50]
.   CALL l(6) tc(1)
.   .   DOT l(6) tc(1)
.   .   .   NAME-r G0 u(1) a(1) l(3) x(0+0) class(PEXTERN) tc(1) used(1)
.   .   .   NAME-m G0 u(1) a(1) l(6) x(0+0)
test.go:3: undefined: f
test.go:6: internal compiler error: walkexpr: switch 1 unknown op CALL l(6) tc(1)

3. What version of the compiler are you using?  (Run it with the -V flag.)
8g version weekly.2011-06-16 8838+
@griesemer
Copy link
Contributor

Comment 1:

Here's a slightly simpler version with similar crash:
package main
var r = f
func main() {
    r()
}
6g test.go
walk [100850788]
.   CALL l(4) tc(1)
.   .   NAME-r G0 u(1) a(1) l(2) x(0+0) class(PEXTERN) tc(1) used(1)
test.go:2: undefined: f
test.go:4: internal compiler error: walkexpr: switch 1 unknown op CALL l(4) tc(1)

Labels changed: added compilerbug.

Owner changed to @rsc.

Status changed to Accepted.

@gopherbot
Copy link
Contributor

Comment 2 by m@capitanio.org:

I've got a similar bug:
package main
import (
        //"io"
        "bytes"
)
func blahblah(w io.Writer) {
        w.Write([]byte(""))
}
func blah() {
        blahblah(bytes.NewBuffer(nil))
}
func main() {}
walk [7f96a814ec00]
.   CALL l(9) tc(1)
.   .   DOT l(9) tc(1)
.   .   .   NAME-w G139 u(1) a(1) g(139) l(8) x(0+0) class(PPARAM) f(1) tc(1) used(1)
.   .   .   NAME-Write G0 u(1) a(1) l(9) x(0+0)
.   CALL-list
.   .   ARRAYLIT l(9) tc(1) []uint8
.   .   .   LITERAL-I1 u(1) a(1) l(9) ideal
.   .   ARRAYLIT-list
.   .   .   KEY l(9)
.   .   .   .   LITERAL-I0 u(1) a(1) l(9) tc(1) ideal
.   .   .   .   LITERAL-I63 u(1) a(1) l(9) tc(1) uint8
test.go:8: undefined: io
test.go:9: internal compiler error: walkexpr: switch 1 unknown op CALL l(9) tc(1)

@rsc
Copy link
Contributor

rsc commented Jul 28, 2011

Comment 3:

This issue was closed by revision 2f8190a.

Status changed to Fixed.

@lvdlvd
Copy link

lvdlvd commented Nov 3, 2011

Comment 4:

Issue #2000 has been merged into this issue.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
@rsc rsc removed their assignment Jun 22, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants