You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following program sample.go triggers an unexpected result
package main
import"github.com/traefik/yaegi/interp"constcode=`package mainfunc main() { a, b, c := 1, 2 _, _, _ = a, b, c}`funcmain() {
i:=interp.New(interp.Options{})
_, err:=i.Compile(code)
println("err:", err.Error())
}
Expected result
err: cannot assign 2 values to 3 variables
Got
panic: runtime error: index out of range [5] with length 5 [recovered] panic: 5:2: CFG post-order panic: runtime error: index out of range [5] with length 5goroutine 1 [running]:github.com/traefik/yaegi/interp.(*Interpreter).cfg.func2.1() /gopath/pkg/mod/github.com/traefik/yaegi@v0.15.1/interp/cfg.go:601 +0x74panic({0x12b0620?, 0xc0000a8090?}) /usr/local/go/src/runtime/panic.go:920 +0x270github.com/traefik/yaegi/interp.(*Interpreter).cfg.func2(0xc0000eb040) /gopath/pkg/mod/github.com/traefik/yaegi@v0.15.1/interp/cfg.go:642 +0x9bc5github.com/traefik/yaegi/interp.(*node).Walk(0xc0000eb040, 0xc0000f5cc8, 0xc0000f5d10)
Yaegi Version
v0.15.1
Additional Notes
No response
The text was updated successfully, but these errors were encountered:
chikaku
added a commit
to chikaku/yaegi
that referenced
this issue
Jan 25, 2024
The following program
sample.go
triggers an unexpected resultExpected result
err: cannot assign 2 values to 3 variables
Got
Yaegi Version
v0.15.1
Additional Notes
No response
The text was updated successfully, but these errors were encountered: