Skip to content

Commit

Permalink
Correct systemdefn marshalling, add type info for safety
Browse files Browse the repository at this point in the history
This was causing memory errors with OCaml 5.2.0.
Fixes #116.
  • Loading branch information
bacam committed Nov 28, 2024
1 parent 2ba5ae0 commit 2672914
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,8 @@ let process source_filenames =
let read_systemdefn read_systemdefn_filename =
let fd = open_in_bin read_systemdefn_filename in
let sd,lookup ,sd_unquotiented, sd_quotiented_unaux =
try Marshal.from_channel fd
try (Marshal.from_channel fd :
(Types.systemdefn * (string -> bool -> string -> Types.symterm list) * Types.systemdefn * Types.systemdefn))
with Failure s -> Auxl.error None ("Cannot read dumped systemdefn\n " ^ s ^"\n")
in
close_in fd;
Expand All @@ -709,7 +710,10 @@ let output_stage (sd,lookup,sd_unquotiented,sd_quotiented_unaux) =
| None -> ()
| Some s ->
let fd = open_out_bin s in
Marshal.to_channel fd (sd,lookup,sd_unquotiented) [Marshal.Closures];
Marshal.to_channel fd (
(sd,lookup,sd_unquotiented,sd_quotiented_unaux) :
(Types.systemdefn * (string -> bool -> string -> Types.symterm list) * Types.systemdefn * Types.systemdefn))
[Marshal.Closures];
close_out fd;
print_string ("system definition in file: " ^ s ^ "\n") );

Expand Down

0 comments on commit 2672914

Please sign in to comment.