Skip to content

cmd/compile: internal compiler error: walkExpr: switch 1 unknown op RECOVER #51839

@ahazhangxin

Description

@ahazhangxin

What version of Go are you using (go version)?

$ go version
go version go1.18 darwin/amd64

Does this issue reproduce with the latest release?

it is already the latest version

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/zhangxin/Library/Caches/go-build"
GOENV="/Users/zhangxin/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/zhangxin/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/zhangxin/go"
GOPROXY="https://goproxy.io,direct"
GOROOT="/usr/local/Cellar/go/1.18/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.18/libexec/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.18"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/dg/2q4522bs3959p0x7tbn61_kw0000gn/T/go-build3463372418=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

go func() { defer func() { if r := recover(); r != nil { glog.Errorf("error=%v", r) } }() }

it seems fixed in https://go-review.googlesource.com/c/go/+/342350/
but in this version it appears again

What did you expect to see?

compiles correctly

What did you see instead?

walk . RECOVER INTER-interface {} tc(1) # hello_dao.go:50:21 hello_dao.go:50:21: internal compiler error: walkExpr: switch 1 unknown op RECOVER

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions