Le 28/07/2026 à 17:49, Andrew Cooper a écrit :
The Store_field(result, 16, arch_config) sits inside an ifdef x86, meaning
that on other archtiectures the pointer is not filled in.  The Ocaml runtime
then falls over a NULL pointer (really the Val_unit used to initialise
'result') when the layout in the heap doesn't match the type system.

Rearrange alloc_domaininfo() to avoid this.  Similarly to
physinfo_arch_caps(), raise an exception if the architecture code hasn't
filled in an appropriate tag.  Move the setup of arch_domainconfig to be
common logic.

In order to simplify the addition of other architectures, remove the
arch_config variable (resuing tmp as it's touched exactly once), and rename
x86_arch_config to be arch_config so each architecture can fill in a suitable
one without needing more local variables.

Reported-by: Julian Vetter <[email protected]>
Signed-off-by: Andrew Cooper <[email protected]>

Reviewed-by: Teddy Astie <[email protected]>

I guess that requires the OCaml user side to be appropriately patched to not get data in the wrong order ?

Teddy

Attachment: OpenPGP_0x660FA9D102CBCFD0.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to