Validate.bpf_check.go: def of bend-osdev-bpf@0.1.0.0 Import: import bend-osdev-bpf@0.1.0.0/validate.bend as Validate Lines 111-126 of bend-osdev-bpf@0.1.0.0/validate.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-bpf@0.1.0.0/validate.bend&start_line=111&end_line=126 import Base import bend-osdev-bpf@0.1.0.0/insn.bend as I # the same as a tail call: ok is the verdict so far, and n counts the # instructions from pc on; the loop stops at the instruction after a failure def bpf_check.go(xs: List<&2, I.BpfOp>, +pc: Nat, ok: Result<&2, &2, I.BpfError, Unit>, n: Nat) -> Result<&2, &2, I.BpfError, Unit>: match xs: case Nil{}: ok case Con{op, t}: match ok: case Fail{e}: Fail{e} case Done{u}: match n: case 0n: bpf_check.go(t, 1n+pc, bpf_check.op(op, pc, 0n), 0n) case 1n+(+r): bpf_check.go(t, 1n+pc, bpf_check.op(op, pc, r), r) Uses (7): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Unit https://jend.leeeet.dev/definition.txt?path=bend-osdev-bpf@0.1.0.0/insn.bend&name=BpfError https://jend.leeeet.dev/definition.txt?path=bend-osdev-bpf@0.1.0.0/insn.bend&name=BpfOp https://jend.leeeet.dev/definition.txt?path=bend-osdev-bpf@0.1.0.0/validate.bend&name=bpf_check.op