safeCall invokes a fuzz harness, recovering from any panic and returning the harness result or -1 on panic.
(fn func([]byte) int, in []byte)
| 878 | // safeCall invokes a fuzz harness, recovering from any panic and returning |
| 879 | // the harness result or -1 on panic. |
| 880 | func safeCall(fn func([]byte) int, in []byte) int { |
| 881 | var v int |
| 882 | defer func() { |
| 883 | if r := recover(); r != nil { |
| 884 | v = -1 |
| 885 | } |
| 886 | }() |
| 887 | v = fn(in) |
| 888 | return v |
| 889 | } |
| 890 | |
| 891 | // --------------------------------------------------------------------------- |
| 892 | // Property: every public surface is panic-free on random bytes (universal) |
no outgoing calls
no test coverage detected