Validate.bpf_mem.step: def of bend-osdev-bpf@0.1.0.0 Import: import bend-osdev-bpf@0.1.0.0/validate.bend as Validate Lines 178-194 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=178&end_line=194 import Base import bend-osdev-bpf@0.1.0.0/insn.bend as I # one instruction, given the slots written on every path to it def bpf_mem.step(op: I.BpfOp, +pc: Nat, +now: U32, ahead: List<&2, U32>) -> BpfInitStep: match op: case I.BpfLdMem{k}: bpf_mem.read(pc, now, k, ahead) case I.BpfLdxMem{k}: bpf_mem.read(pc, now, k, ahead) case I.BpfSt{k}: BpfInitStep{Done{Unit{}}, U32.or(now, bpf_mem.bit(k)), ahead} case I.BpfStx{k}: BpfInitStep{Done{Unit{}}, U32.or(now, bpf_mem.bit(k)), ahead} case I.BpfJa{k}: BpfInitStep{Done{Unit{}}, 65535, bpf_mem.meet(ahead, U32.to_nat(k), now)} case I.BpfJmp{c, src, jt, jf}: BpfInitStep{Done{Unit{}}, 65535, bpf_mem.meet(bpf_mem.meet(ahead, U32.to_nat(jt), now), U32.to_nat(jf), now)} case other: BpfInitStep{Done{Unit{}}, now, ahead} Uses (12): 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=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.or https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat 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=BpfOp https://jend.leeeet.dev/definition.txt?path=bend-osdev-bpf@0.1.0.0/validate.bend&name=BpfInitStep https://jend.leeeet.dev/definition.txt?path=bend-osdev-bpf@0.1.0.0/validate.bend&name=bpf_mem.bit https://jend.leeeet.dev/definition.txt?path=bend-osdev-bpf@0.1.0.0/validate.bend&name=bpf_mem.meet https://jend.leeeet.dev/definition.txt?path=bend-osdev-bpf@0.1.0.0/validate.bend&name=bpf_mem.read