Closed perimosocordiae closed 2 years ago
Yes, we write 0xAA bytes in debug mode into memory that would be uninitialized in opt-mode, so this is a bug in the IR-generation. We're likely reading the register holding the length but never wrote to it.
To clarify, it's reading the file correctly just the length is wrong? Meaning the call to printf("%*s", ...)
likely is getting lucky regarding null terminators.
Yup, the printing must be hitting the null byte and stopping, rather than trying to print all 0xAAAA... bytes.
This bug is relatively new, by the way, because the length was initialized properly back when I wrote my day 9 advent solution. I suspect it popped up in the last week or two's changes.
Looks like the length field of the slice is left uninitialized?