Was passing zeros to the string print function.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
IntegerToString returns a string view carefully sized to display only the digits from the number. Before this patch, we pass the whole line_str buffer. This prints as the empty string for integers that don't fill the buffer.
It's statically known that the value will fit in the buffer but the existing interface returns an optional. I haven't found an existing equivalent that returns a string view for statically sufficient buffer size, might be worth writing one.
Unrelated to this, but I'm surprised assert lowers to eight calls to write_to_stderr and some runtime number conversion. I expected it to concatenate the strings and do the line number -> string conversion at preprocessor time, resolving to a single call to write_to_stderr with a compile time constant string literal.
this ^ is addressed by the wip D155902