The following program sample.go triggers an unexpected result
n/a
Expected result
Error
Got
panic
Yaegi Version
381e045
Additional Notes
I'm having a hard time reproducing this at the moment, but the t == nil line in the below snippet from interp/type.go allows returning a nil value from nodetype2, which lots of places use without checking if it's nil (including right inside nodetype2), which causes a panic:
I suspect that me hitting this case was a result of using Yaegi incorrectly (possibly from using ImportUsed but not actually importing those packages in the Eval'ed code), which I'm not doing any more, which is why I'm not seeing it, but I feel like the t == nil case should clearly at least return an error.
The following program
sample.go
triggers an unexpected resultExpected result
Got
Yaegi Version
381e045
Additional Notes
I'm having a hard time reproducing this at the moment, but the
t == nil
line in the below snippet frominterp/type.go
allows returning anil
value fromnodetype2
, which lots of places use without checking if it'snil
(including right insidenodetype2
), which causes a panic:https://github.com/traefik/yaegi/blob/381e045966b079ca0ac364ba111fcb603226a74b/interp/type.go#L1119-L1127
I suspect that me hitting this case was a result of using Yaegi incorrectly (possibly from using
ImportUsed
but not actually importing those packages in the Eval'ed code), which I'm not doing any more, which is why I'm not seeing it, but I feel like thet == nil
case should clearly at least return an error.