CmmToAsm: fix errornous trailing zero byte when emitting CmmFileEmbed
CmmToAsm: fix errornous trailing zero byte when emitting CmmFileEmbed
The X86 NCG emits an extra trailing zero after each CmmFileEmbed
. This is wrong:
- When we lower a large blob to
CmmFileEmbed
, the temporary file contains the exact same bytes in the originalStgTopStringLit
. It may contain any byte pattern, and has absolutely no guarantee to be a NUL-terminated C string. - No other NCG backend emits it.
This hasn't caused runtime issues before, mainly because large blobs tend to be their own CmmData
sections, so they don't screw up the offsets of other CmmStatic
s that follow. Still, it should be corrected to remove a potential source of coufusion and incoherency between all NCG backends.