Skip to content

Commit 2b7899b

Browse files
committed
[Reproducer] Surface error if setting the cwd fails
Make sure that we surface an error if setting the current working directory fails during replay. llvm-svn: 375146
1 parent e19dfa6 commit 2b7899b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lldb/source/Initialization/SystemInitializerCommon.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,13 @@ llvm::Error SystemInitializerCommon::Initialize() {
8080
}
8181
if (llvm::Expected<std::string> cwd =
8282
loader->LoadBuffer<WorkingDirectoryProvider>()) {
83-
FileSystem::Instance().GetVirtualFileSystem()->setCurrentWorkingDirectory(
84-
*cwd);
83+
cwd->erase(std::remove_if(cwd->begin(), cwd->end(), std::iscntrl),
84+
cwd->end());
85+
if (std::error_code ec = FileSystem::Instance()
86+
.GetVirtualFileSystem()
87+
->setCurrentWorkingDirectory(*cwd)) {
88+
return llvm::errorCodeToError(ec);
89+
}
8590
} else {
8691
return cwd.takeError();
8792
}

0 commit comments

Comments
 (0)