Skip to content

Commit

Permalink
Fix caml_natdynlink_run_toplevel to actually call the registration fu…
Browse files Browse the repository at this point in the history
…nction
  • Loading branch information
mshinwell committed Nov 20, 2023
1 parent 61c5e3a commit bc9a60d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ocaml/runtime4/dynlink_nat.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ CAMLprim value caml_natdynlink_run(value handle_v, value symbol) {
CAMLprim value caml_natdynlink_run_toplevel(value filename, value symbol)
{
CAMLparam2 (filename, symbol);
CAMLlocal3 (res, v, handle_v);
CAMLlocal4 (res, v, handle_v, symbols);
void *handle;
char_os *p;

Expand All @@ -203,10 +203,16 @@ CAMLprim value caml_natdynlink_run_toplevel(value filename, value symbol)
Store_field(res, 0, v);
} else {
handle_v = Val_handle(handle);

symbols = caml_alloc_small(1, 0);
Field(symbols, 0) = symbol;
(void) caml_natdynlink_register(handle_v, symbols);

res = caml_alloc(1,0);
v = caml_natdynlink_run(handle_v, symbol);
Store_field(res, 0, v);
}

CAMLreturn(res);
}

Expand Down

0 comments on commit bc9a60d

Please sign in to comment.