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.
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user