diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-04-13 11:10:17 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-04-13 11:10:17 -0400 |
| commit | 1999f0daad505f414f97845ecde0a56b3c2fedfd (patch) | |
| tree | 185598cde3a3f8b2320484e262899db5bc85b09e /src/main.cpp | |
| parent | 0f652b4d80a57f5b5a1054d06cd5767ce52402a1 (diff) | |
| download | zig-1999f0daad505f414f97845ecde0a56b3c2fedfd.tar.gz zig-1999f0daad505f414f97845ecde0a56b3c2fedfd.zip | |
fix undefined behavior triggered by fn inline test
LLVM destroys the string that we use to test if LLVM deleted the
inlined function.
Also fixed forgetting to initialize a buffer in std lib path detection.
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index 63b077e833..37d1c91170 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -179,6 +179,7 @@ static int find_zig_lib_dir(Buf *out_path) { Buf self_exe_path = BUF_INIT; if (!(err = os_self_exe_path(&self_exe_path))) { Buf *cur_path = &self_exe_path; + buf_resize(cur_path, 0); for (;;) { Buf *test_dir = buf_alloc(); |
