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

**URL:** <https://discuss.ocaml.org/t/low-hanging-fruit-for-a-pr-contribution-to-the-ocaml-runtime-code-c-code/11914>\
**Category:** Community\
**Tags:** compiler\
**Created:** [April 8, 2023, 2:28pm UTC](https://discuss.ocaml.org/t/low-hanging-fruit-for-a-pr-contribution-to-the-ocaml-runtime-code-c-code/11914 "2023-04-08T14:28:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gasche](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/gasche/32/4_2.png) [@gasche](https://discuss.ocaml.org/u/gasche)\
**Post date:** [April 8, 2023, 2:28pm UTC](https://discuss.ocaml.org/t/low-hanging-fruit-for-a-pr-contribution-to-the-ocaml-runtime-code-c-code/11914/1 "2023-04-08T14:28:26Z")

</div>

I’m the shepherd for the upstream compiler issue [get\_extern\_state potential NULL dereference · Issue #12037 · ocaml/ocaml · GitHub](https://github.com/ocaml/ocaml/issues/12037) , 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:

- 1h to get familiar with the github/ocaml repository (clone it, configure it, build it, etc.; I am assuming that you are not trying to program from a Windows machine, which may be harder), which includes skimming [ocaml/CONTRIBUTING.md at trunk · ocaml/ocaml · GitHub](https://github.com/ocaml/ocaml/blob/trunk/CONTRIBUTING.md) and [ocaml/HACKING.adoc at trunk · ocaml/ocaml · GitHub](https://github.com/ocaml/ocaml/blob/trunk/HACKING.adoc)
- 1h-2h to write an initial patch that you are happy with and send a PR
- 1h-3h of addressing CI issues and review comments

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

---

<div class="post-metadata">

**Author:** ![gasche](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/gasche/32/4_2.png) [@gasche](https://discuss.ocaml.org/u/gasche)\
**Post date:** [April 18, 2023, 7:33am UTC](https://discuss.ocaml.org/t/low-hanging-fruit-for-a-pr-contribution-to-the-ocaml-runtime-code-c-code/11914/2 "2023-04-18T07:33:16Z")

</div>

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](https://github.com/ocaml/ocaml/pull/12171) . Thanks!
