Revert iterative cek_run, restore working WASM kernel
Iterative cek_run broke page-script parsing in browser. Reverted to recursive — bytecode compilation overflow handled by native Sx_compiler. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -374,16 +374,11 @@ and expand_macro mac raw_args env =
|
|||||||
|
|
||||||
(* cek-run *)
|
(* cek-run *)
|
||||||
and cek_run state =
|
and cek_run state =
|
||||||
(* Iterative loop — no stack growth. Essential for WASM where JS stack is limited. *)
|
(if sx_truthy ((cek_terminal_p (state))) then (cek_value (state)) else
|
||||||
let s = ref state in
|
try cek_run ((cek_step (state)))
|
||||||
(try
|
with Eval_error msg ->
|
||||||
while not (match cek_terminal_p !s with Bool true -> true | _ -> false) do
|
(if !_last_error_kont = Nil then _last_error_kont := cek_kont state);
|
||||||
s := cek_step !s
|
raise (Eval_error msg))
|
||||||
done;
|
|
||||||
cek_value !s
|
|
||||||
with Eval_error msg ->
|
|
||||||
(if !_last_error_kont = Nil then _last_error_kont := cek_kont !s);
|
|
||||||
raise (Eval_error msg))
|
|
||||||
|
|
||||||
(* cek-step *)
|
(* cek-step *)
|
||||||
and cek_step state =
|
and cek_step state =
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user