DepScanner/ModuleInterface: fix a memory issue when passing down -serialized-path-obfuscate to interface building commands

rdar://88511163
This commit is contained in:
Xi Ge
2022-02-17 13:50:18 -08:00
parent d7d3fe375a
commit 5964d4b683

View File

@@ -1347,8 +1347,9 @@ void InterfaceSubContextDelegateImpl::inheritOptionsForBuildingInterface(
SearchPathOpts.DeserializedPathRecoverer);
SearchPathOpts.DeserializedPathRecoverer
.forEachPair([&](StringRef lhs, StringRef rhs) {
GenericArgs.push_back(ArgSaver.save(llvm::Twine("-serialized-path-obfuscate ")
+ lhs + "=" + rhs).str());
GenericArgs.push_back("-serialized-path-obfuscate");
std::string pair = (llvm::Twine(lhs) + "=" + rhs).str();
GenericArgs.push_back(ArgSaver.save(pair));
});
}