diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-10-26 00:32:30 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-10-26 00:32:30 -0400 |
| commit | c7053bea204f87fe1c8b28ec97b27003a24dcafc (patch) | |
| tree | e6607a7abb0ae8a9f86e31e146a72e7c71ce1c73 /src/errmsg.cpp | |
| parent | 300c83d8930d15d4bc4e34fe11e3b6bf3130ecc4 (diff) | |
| download | zig-c7053bea204f87fe1c8b28ec97b27003a24dcafc.tar.gz zig-c7053bea204f87fe1c8b28ec97b27003a24dcafc.zip | |
better output when @cImport generates invalid zig
Diffstat (limited to 'src/errmsg.cpp')
| -rw-r--r-- | src/errmsg.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/errmsg.cpp b/src/errmsg.cpp index bef4d7548d..01c3ee8429 100644 --- a/src/errmsg.cpp +++ b/src/errmsg.cpp @@ -123,6 +123,7 @@ ErrorMsg *err_msg_create_with_line(Buf *path, size_t line, size_t column, size_t end_line = line + 1; size_t line_end_offset = (end_line >= line_offsets->length) ? buf_len(source) : line_offsets->at(line + 1); size_t len = (line_end_offset + 1 > line_start_offset) ? (line_end_offset - line_start_offset - 1) : 0; + if (len == SIZE_MAX) len = 0; buf_init_from_mem(&err_msg->line_buf, buf_ptr(source) + line_start_offset, len); |
