MCPcopy Create free account
hub / github.com/buger/jsonparser / runPathOp

Function runPathOp

path_fuzz_test.go:143–155  ·  view source on GitHub ↗

runPathOp runs a single parser operation with crash-capture recovery. On panic, the crash is recorded to disk and the counter is incremented; the test continues. Returns true if the operation completed without panicking.

(target string, data, path []byte, fn func())

Source from the content-addressed store, hash-verified

141// the test continues. Returns true if the operation completed without
142// panicking.
143func runPathOp(target string, data, path []byte, fn func()) (ok bool) {
144 defer func() {
145 if r := recover(); r != nil {
146 pathCrashCounter++
147 recordPathCrash(target, r, debug.Stack(), data, path)
148 ok = false
149 return
150 }
151 ok = true
152 }()
153 fn()
154 return true
155}
156
157// FuzzPathMutation mutates BOTH the JSON bytes and the key-path bytes,
158// then exercises the full parser surface. This is the harness that would

Callers 2

FuzzPathMutationFunction · 0.85

Calls 1

recordPathCrashFunction · 0.85

Tested by

no test coverage detected