mirror of
https://github.com/ziglang/zig.git
synced 2026-01-09 08:55:36 +00:00
translate-c: fix sometimes getting (no file) warnings
Thanks to Mason Remaley for testing the fix.
This commit is contained in:
parent
3e8fd24547
commit
1ab84a27d3
@ -138,7 +138,7 @@ static void emit_warning(Context *c, const SourceLocation &sl, const char *forma
|
||||
Buf *msg = buf_vprintf(format, ap);
|
||||
va_end(ap);
|
||||
|
||||
StringRef filename = c->source_manager->getFilename(sl);
|
||||
StringRef filename = c->source_manager->getFilename(c->source_manager->getSpellingLoc(sl));
|
||||
const char *filename_bytes = (const char *)filename.bytes_begin();
|
||||
Buf *path;
|
||||
if (filename_bytes) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user