runtime: panic reported on wrong line on deferred statements #41180
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
If we try to
close
anil
channel on adefer
, or if we try to call anil
function on adefer
, then we get apanic
on thereturn
statement while the line with thedefer
is not reported in the stack trace.https://play.golang.org/p/mcO-A4WRWXC
https://play.golang.org/p/eQnYvAcaLCD
What did you expect to see?
I'd expect to see the
defer
statement in thepanic
stack trace. If you look at the links to the playground above, line 10 is not reported, we can see only lines 12 and 16.What did you see instead?
I see only lines 12 and 16, not line 10 (the one with the
defer
).The text was updated successfully, but these errors were encountered: