aboutsummaryrefslogtreecommitdiff
path: root/src/zig_clang_driver.cpp
diff options
context:
space:
mode:
authorMichael Dusan <michael.dusan@gmail.com>2021-05-24 02:29:22 -0400
committerAndrew Kelley <andrew@ziglang.org>2021-05-24 13:26:52 -0400
commit1dc7764f2ddc2f3bd78f96017fd2dd2227280055 (patch)
tree005c17f6ccc44fd1469ab7c8fe483af01cfa6b8d /src/zig_clang_driver.cpp
parent6426519e32bc5d0470d6a2775050b9e303823a62 (diff)
downloadzig-1dc7764f2ddc2f3bd78f96017fd2dd2227280055.tar.gz
zig-1dc7764f2ddc2f3bd78f96017fd2dd2227280055.zip
clang driver: fix lost argv[0]
Diffstat (limited to 'src/zig_clang_driver.cpp')
-rw-r--r--src/zig_clang_driver.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/zig_clang_driver.cpp b/src/zig_clang_driver.cpp
index ac892f95e8..468c437a7d 100644
--- a/src/zig_clang_driver.cpp
+++ b/src/zig_clang_driver.cpp
@@ -448,7 +448,9 @@ int ZigClang_main(int argc_, const char **argv_) {
ApplyQAOverride(argv, OverrideStr, SavedStrings);
}
- std::string Path = GetExecutablePath(argv[0], CanonicalPrefixes);
+ // Pass local param `argv_[0]` as fallback.
+ // See https://github.com/ziglang/zig/pull/3292 .
+ std::string Path = GetExecutablePath(argv_[0], CanonicalPrefixes);
// Whether the cc1 tool should be called inside the current process, or if we
// should spawn a new clang subprocess (old behavior).