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) {
236
236
s .Write (closeBracketBytes )
237
237
}
238
238
239
- // findSigpanic intentially executes faulting code to generate a stack trace
239
+ // findSigpanic intentionally executes faulting code to generate a stack trace
240
240
// containing an entry for runtime.sigpanic.
241
241
func findSigpanic () * runtime.Func {
242
242
var fn * runtime.Func
243
+ var p * int
243
244
func () int {
244
245
defer func () {
245
246
if p := recover (); p != nil {
@@ -254,9 +255,8 @@ func findSigpanic() *runtime.Func {
254
255
}
255
256
}
256
257
}()
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
260
260
}()
261
261
return fn
262
262
}
You can’t perform that action at this time.
0 commit comments