Fix JIT nil-param crash: guard execute-request, restore error logging
- orchestration.sx: add nil guard for verb/url before calling do-fetch (prevents "Expected string, got nil" when verb info dict lacks method) - sx_browser.ml: restore JIT error logging (Eval_error only, not all exceptions) so real failures are visible, silence routine fallbacks - Rebuild WASM bundle with fixes Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -582,9 +582,9 @@ let () =
|
||||
(match l.l_compiled with
|
||||
| Some cl when not (Sx_vm.is_jit_failed cl) ->
|
||||
(try Some (Sx_vm.call_closure cl args cl.vm_env_ref)
|
||||
with e ->
|
||||
with Eval_error msg ->
|
||||
let fn_name = match l.l_name with Some n -> n | None -> "?" in
|
||||
Printf.eprintf "[jit] DISABLED %s — %s\n%!" fn_name (Printexc.to_string e);
|
||||
Printf.eprintf "[jit] DISABLED %s — %s\n%!" fn_name msg;
|
||||
l.l_compiled <- Some Sx_vm.jit_failed_sentinel;
|
||||
None)
|
||||
| Some _ -> None
|
||||
@@ -595,18 +595,14 @@ let () =
|
||||
let globals = env_to_vm_globals global_env in
|
||||
let compiled = Sx_vm.jit_compile_lambda l globals in
|
||||
_jit_compiling := false;
|
||||
let fn_name = match l.l_name with Some n -> n | None -> "?" in
|
||||
(match compiled with
|
||||
| Some cl ->
|
||||
l.l_compiled <- Some cl;
|
||||
(try Some (Sx_vm.call_closure cl args cl.vm_env_ref)
|
||||
with e ->
|
||||
Printf.eprintf "[jit] DISABLED %s — %s\n%!" fn_name (Printexc.to_string e);
|
||||
with _ ->
|
||||
l.l_compiled <- Some Sx_vm.jit_failed_sentinel;
|
||||
None)
|
||||
| None ->
|
||||
Printf.eprintf "[jit] FAIL %s\n%!" fn_name;
|
||||
None)
|
||||
| None -> None)
|
||||
end)
|
||||
| _ -> None)
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
(if (and prompt-msg (nil? prompt-val))
|
||||
(promise-resolve nil)
|
||||
;; Validation gate
|
||||
(if (not (validate-for-request el))
|
||||
(if (or (nil? verb) (nil? url) (not (validate-for-request el)))
|
||||
(promise-resolve nil)
|
||||
(do-fetch el verb verb url
|
||||
(if prompt-val
|
||||
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
@@ -1792,7 +1792,7 @@
|
||||
blake2_js_for_wasm_create: blake2_js_for_wasm_create};
|
||||
}
|
||||
(globalThis))
|
||||
({"link":[["runtime-0db9b496",0],["prelude-d7e4b000",0],["stdlib-23ce0836",[]],["sx-ea36a0db",[2]],["jsoo_runtime-f96b44a8",[2]],["js_of_ocaml-651f6707",[2,4]],["dune__exe__Sx_browser-cafa954c",[2,3,5]],["std_exit-10fb8830",[2]],["start-29cf9a72",0]],"generated":(b=>{var
|
||||
({"link":[["runtime-0db9b496",0],["prelude-d7e4b000",0],["stdlib-23ce0836",[]],["sx-ea36a0db",[2]],["jsoo_runtime-f96b44a8",[2]],["js_of_ocaml-651f6707",[2,4]],["dune__exe__Sx_browser-8f530291",[2,3,5]],["std_exit-10fb8830",[2]],["start-29cf9a72",0]],"generated":(b=>{var
|
||||
c=b,a=b?.module?.export||b;return{"env":{"caml_ba_kind_of_typed_array":()=>{throw new
|
||||
Error("caml_ba_kind_of_typed_array not implemented")},"caml_exn_with_js_backtrace":()=>{throw new
|
||||
Error("caml_exn_with_js_backtrace not implemented")},"caml_int64_create_lo_mi_hi":()=>{throw new
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
(if (and prompt-msg (nil? prompt-val))
|
||||
(promise-resolve nil)
|
||||
;; Validation gate
|
||||
(if (not (validate-for-request el))
|
||||
(if (or (nil? verb) (nil? url) (not (validate-for-request el)))
|
||||
(promise-resolve nil)
|
||||
(do-fetch el verb verb url
|
||||
(if prompt-val
|
||||
|
||||
Reference in New Issue
Block a user