File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -236,10 +236,11 @@ func (cs CallStack) Format(s fmt.State, verb rune) {
236236 s .Write (closeBracketBytes )
237237}
238238
239- // findSigpanic intentially executes faulting code to generate a stack trace
239+ // findSigpanic intentionally executes faulting code to generate a stack trace
240240// containing an entry for runtime.sigpanic.
241241func findSigpanic () * runtime.Func {
242242 var fn * runtime.Func
243+ var p * int
243244 func () int {
244245 defer func () {
245246 if p := recover (); p != nil {
@@ -254,9 +255,8 @@ func findSigpanic() *runtime.Func {
254255 }
255256 }
256257 }()
257- // intentional division by zero fault
258- a , b := 1 , 0
259- return a / b
258+ // intentional nil pointer dereference to trigger sigpanic
259+ return * p
260260 }()
261261 return fn
262262}
You can’t perform that action at this time.
0 commit comments