61ebe5123 made defines.h include <sys/types.h> ahead of <inttypes.h>:
with an arm-none-eabi toolchain whose <stdint.h> is GCC's own, newlib's
<inttypes.h> never sees the marker it tests before defining the 64-bit
PRI macros, and PRIu64 goes undefined while PRIu32 does not. 400b21739
("Remove defines") took the header out and the workaround with it, so
a cross build of integer.c and errors_format.c, the two files that
include <inttypes.h> now, fails on such a toolchain (Debian's
gcc-arm-none-eabi 13.2.1 with newlib). Put the include back in those
two files, with the note.
https://github.com/ruby/prism/commit/ff42521e49
The PM_INTEGER_BASE_DEFAULT branch skips leading zeros without checking
`end`, so it reads one byte past the range for an all-zero input.
pm_float_node_rational_create() reaches it: it allocates `length` bytes
for the mantissa, writes only `length - 1` of them because the decimal
point is squeezed out, and passes end = digits + length - 1. Parsing
`+0.0r` then walks the skip onto the byte that was never written.
$ valgrind ./parse +0.0r
Conditional jump or move depends on uninitialised value(s)
at pm_integer_parse (integer.c:506)
by pm_float_node_rational_create (prism.c:3963)
by parse_expression_prefix (prism.c:17898)
The value parsed is unaffected, since `start >= end` returns 0 either
way. The other bases already guard with `(end - start) > 1`.
Found by an mruby fuzzer testcase.
https://github.com/ruby/prism/commit/f9629ee735