From 91185beb7be9e9786348bd68df13f8ad96532ec6 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Sat, 12 Sep 2026 04:01:40 +0700 Subject: [PATCH] Also pin the two things SBCL's presentation was worth A listing rebased to the function and branch targets that read as labels are the whole difference between something you can follow and a dump; both looked fine by eye and neither was checked by anything. --- test/test_dev.ml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/test/test_dev.ml b/test/test_dev.ml index 659a925..8d7f68e 100644 --- a/test/test_dev.ml +++ b/test/test_dev.ml @@ -537,7 +537,26 @@ let () = | Some o when Filename.check_suffix o ".so" -> () | o -> fail "the code did not come from a .so: %s" (Option.value ~default:"" o) - end + end; + (* The other presentation borrow, and the one that needs a body with + somewhere to jump to: a branch inside the function reads as [L0] + rather than as an address into an object nobody will open. *) + let r = + request c + "(:op \"eval\" :code \"(defn wind [n i32] i32 (let [acc 0] (dotimes [i n] (set acc (+ acc i))) acc))\" :file \"/tmp/disasm.flan\")" + in + if status r <> "ok" then + fail "installing a body with a loop in it: %s" + (Option.value ~default:"" (Wire.string_field r "message")) + else + let r = request c "(:op \"disassemble\" :name \"wind\" :form \"asm\")" in + if status r <> "ok" then + fail "the machine code of a loop: %s" + (Option.value ~default:"" (Wire.string_field r "message")) + else if not (has (text r) "L0:") then + fail "a branch target is not labelled: %S" (text r) + else if has (text r) "