File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -371,7 +371,12 @@ func dumpgoroutine(gp *g) {
371
371
dumpint (uint64 (d .sp ))
372
372
dumpint (uint64 (d .pc ))
373
373
dumpint (uint64 (uintptr (unsafe .Pointer (d .fn ))))
374
- dumpint (uint64 (uintptr (unsafe .Pointer (d .fn .fn ))))
374
+ if d .fn == nil {
375
+ // d.fn can be nil for open-coded defers
376
+ dumpint (uint64 (0 ))
377
+ } else {
378
+ dumpint (uint64 (uintptr (unsafe .Pointer (d .fn .fn ))))
379
+ }
375
380
dumpint (uint64 (uintptr (unsafe .Pointer (d .link ))))
376
381
}
377
382
for p := gp ._panic ; p != nil ; p = p .link {
Original file line number Diff line number Diff line change @@ -824,10 +824,10 @@ type _defer struct {
824
824
// defers. We have only one defer record for the entire frame (which may
825
825
// currently have 0, 1, or more defers active).
826
826
openDefer bool
827
- sp uintptr // sp at time of defer
828
- pc uintptr // pc at time of defer
829
- fn * funcval
830
- _panic * _panic // panic that is running defer
827
+ sp uintptr // sp at time of defer
828
+ pc uintptr // pc at time of defer
829
+ fn * funcval // can be nil for open-coded defers
830
+ _panic * _panic // panic that is running defer
831
831
link * _defer
832
832
833
833
// If openDefer is true, the fields below record values about the stack
You can’t perform that action at this time.
0 commit comments