Fix C harness JSON output for non-finite doubles

Merged
JE
1d ago
+80-2

When a C solution returns inf or NaN, the harness prints it directly into the JSON output. This make the whole result invalid, so even passing cases disappear.

This change prints null for non-finite doubles, like the C++ and Java runners already do. It handles both double and double[].

I added four regression tests for infinity, negative infinity, NaN, and mixed arrays. They fail before the fix and pass afterward. All 66 tests in the compiler-explorer test file pass.

The full test suite still has some local failures due to missing assets, plus a C++ test that was terminated. Rerunning the compiler-explorer test file on its own passed.


Summary by cubic

Fixes the C harness so non-finite doubles (inf, -inf, NaN) serialize as null instead of raw inf/nan strings, which were corrupting the entire JSON output and hiding passing results. This makes the C runner consistent with the existing C++ and Java runners. Applies to both double and double[] return types, and adds regression tests for all non-finite cases plus mixed finite/non-finite arrays.

Closes #438