authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-11-28 00:32:32-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-11-28 00:32:32-05:00
log1ab84a27d374e666463c606dc1cd1c4972b52a74
treef8bba378ad0ccf449d24fc143abea2be66fe861b
parent3e8fd245473a6e532fa4f9b42c51bd8257c15b3c

translate-c: fix sometimes getting (no file) warnings

Thanks to Mason Remaley for testing the fix.

1 files changed, 1 insertions(+), 1 deletions(-)

src/translate_c.cpp+1-1
...@@ -138,7 +138,7 @@ static void emit_warning(Context *c, const SourceLocation &sl, const char *forma...@@ -138,7 +138,7 @@ static void emit_warning(Context *c, const SourceLocation &sl, const char *forma
138 Buf *msg = buf_vprintf(format, ap);138 Buf *msg = buf_vprintf(format, ap);
139 va_end(ap);139 va_end(ap);
140140
141 StringRef filename = c->source_manager->getFilename(sl);141 StringRef filename = c->source_manager->getFilename(c->source_manager->getSpellingLoc(sl));
142 const char *filename_bytes = (const char *)filename.bytes_begin();142 const char *filename_bytes = (const char *)filename.bytes_begin();
143 Buf *path;143 Buf *path;
144 if (filename_bytes) {144 if (filename_bytes) {