c2compiler
c2compiler copied to clipboard
embed binary files length incorrect
The last byte of a binary embed (const u8[]) is set to 0. This comes from the fact that it is stored inside a string literal inside the AST, since this is the most efficient way of storing it. Adding a new AST Element type seems like overkill.
It seems this bug was fixed.
On the other hand, I think it should be OK to embed files into arrays of i8, non const arrays, and arrays longer than the file itself, just like strings can be used as initializers for these.