elf: escape invalid token string when reporting an error

This commit is contained in:
Jakub Konka
2023-12-05 14:39:56 +01:00
parent e349bb2b66
commit e3592281da

View File

@@ -32,7 +32,7 @@ pub fn parse(scr: *LdScript, data: []const u8, elf_file: *Elf) Error!void {
switch (tok.id) {
.invalid => {
try elf_file.reportParseError(scr.path, "invalid token in LD script: '{s}' ({d}:{d})", .{
tok.get(data),
std.fmt.fmtSliceEscapeLower(tok.get(data)),
line,
column,
});