[PATCH v1 0/1] libgccjit: Fix UB in constructor functions
Antoni Boucher via Sourceware Forge
forge-bot+antoyo@forge-stage.sourceware.org
Fri May 22 14:49:16 GMT 2026
Antoni Boucher (antoyo)) commented on the code:
> +++ gcc/testsuite/jit.dg/test-aligned-constructor.c
> @@ -0,0 +67,4 @@
> + one,
> + };
> + struct_value =
> + gcc_jit_context_new_struct_constructor (ctxt, NULL, aligned_struct_type,
This doesn't seem to trigger the bug in this test on my computer, unfortunately.
The issue is that since it's UB, `n_el` can get any value and it's often greater than the number of values provided by this function since the latter is very small.
I'm not sure if there would be a better way to test this.
--
https://forge.sourceware.org/gcc/gcc-TEST/pulls/124#issuecomment-4050
More information about the Jit
mailing list