runtime: signal SIGSEGV
This commit is contained in:
24
cl/_testgo/sigsegv/in.go
Normal file
24
cl/_testgo/sigsegv/in.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package main
|
||||
|
||||
type T struct {
|
||||
s int
|
||||
}
|
||||
|
||||
func f() *T {
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
println("init")
|
||||
defer func() {
|
||||
r := recover()
|
||||
if e, ok := r.(error); ok {
|
||||
println("recover", e.Error())
|
||||
}
|
||||
}()
|
||||
println(f().s)
|
||||
}
|
||||
|
||||
func main() {
|
||||
println("main")
|
||||
}
|
||||
1
cl/_testgo/sigsegv/out.ll
Normal file
1
cl/_testgo/sigsegv/out.ll
Normal file
@@ -0,0 +1 @@
|
||||
;
|
||||
Reference in New Issue
Block a user