Skip to content

Commit

Permalink
Compiler: fix for ocaml 5.2 (#1549)
Browse files Browse the repository at this point in the history
  • Loading branch information
hhugo authored Dec 10, 2023
1 parent 5ba7936 commit 94bee37
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
9 changes: 8 additions & 1 deletion compiler/lib/parse_bytecode.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2429,10 +2429,17 @@ and compile infos pc state instrs =
func
Var.print
arg;
let state =
match Ocaml_version.v with
| `V4_08 | `V4_09 | `V4_10 | `V4_11 | `V4_12 | `V4_13 | `V4_14 | `V5_00 | `V5_01
-> State.pop 2 state
| `V5_02 -> State.pop 3 state
in

compile
infos
(pc + 1)
(State.pop 2 state)
state
((Let (x, Prim (Extern "%resume", [ Pv stack; Pv func; Pv arg ])), loc)
:: instrs)
| RESUMETERM ->
Expand Down
21 changes: 14 additions & 7 deletions runtime/zstd.js
Original file line number Diff line number Diff line change
Expand Up @@ -648,13 +648,25 @@ return function decompress(dat, buf) {


//Provides: caml_decompress_input
//Version: > 5.1.0
//Version: < 5.1.0
var caml_decompress_input = null

//Provides: caml_decompress_input
//Version: < 5.1.0
//Version: >= 5.1.0
//Version: < 5.1.1
//Requires: zstd_decompress
var caml_decompress_input = zstd_decompress;

//Provides: caml_decompress_input
//Version: >= 5.1.1
//Version: < 5.2.0
var caml_decompress_input = null

//Provides: caml_decompress_input
//Version: >= 5.2
//Requires: zstd_decompress
var caml_decompress_input = zstd_decompress;

//Provides: caml_zstd_initialize
//Requires: caml_decompress_input
//Requires: zstd_decompress
Expand All @@ -664,8 +676,3 @@ function caml_zstd_initialize(unit) {
return 1
}

//Provides: caml_decompress_input
//Version: >= 5.1
//Version: < 5.1.1
//Requires: zstd_decompress
var caml_decompress_input = zstd_decompress;

0 comments on commit 94bee37

Please sign in to comment.