================
@@ -910,7 +910,10 @@ void darwin::Lipo::ConstructJob(Compilation &C, const 
JobAction &JA,
     CmdArgs.push_back(II.getFilename());
   }
 
-  const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath("lipo"));
+  std::string LipoName =
+      std::string(Args.getLastArgValue(options::OPT_fuse_lipo_EQ, "lipo"));
+  const char *Exec =
+      Args.MakeArgString(getToolChain().GetProgramPath(LipoName.c_str()));
----------------
khyperia wrote:

Ah, StringRef::data() is documented as "data - Get a pointer to the start of 
the string (which may not be null terminated)". Because we're using it as a 
null-terminated string, I thought that making a copy is necessary to ensure 
it's null terminated, in case getLastArgValue ever changes to not return a 
null-terminated string. Depending on it always returning a null terminated 
string seems like what a lot of other code does already, though, I'll make that 
change.

https://github.com/llvm/llvm-project/pull/121231
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to