Low-hanging fruit for a PR contribution to the OCaml runtime code (C code)

I’m the shepherd for the upstream compiler issue get_extern_state potential NULL dereference · Issue #12037 · ocaml/ocaml · GitHub , which is about a potential code improvement noticed by gcc -fanalyzer. The issue has somewhat-detailed explanations of what could be done to solve it nicely.

If you have been looking for an opportunity to contribute to the upstream OCaml compiler, this may be one. This is in the runtime code, implemented in C, and extern.c is the marshaller (what runs when you use output_value or Marhsal.to_string).

Assuming you are already familiar with C and typical git+github workflows, but have never contributed to the OCaml compiler codebase, here would be a time estimate:

Edit: ah, if you start working on this, please post a message on the issue to avoid other people duplicating work.


This issue has been solved by @askvortsov in extern.c: raise OOM instead of passing null in `caml_output_*` entrypoints by askvortsov1 · Pull Request #12171 · ocaml/ocaml · GitHub . Thanks!