Skip to content

Commit d4a425a

Browse files
committed
Squash with "[clang] Enable IO sandboxing in -cc1 and -cc1as"
1 parent f96829e commit d4a425a

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

llvm/lib/Support/Unix/Signals.inc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,7 @@ void sys::unregisterHandlers() {
354354

355355
/// Process the FilesToRemove list.
356356
static void RemoveFilesToRemove() {
357+
[[maybe_unused]] auto BypassSandbox = sys::sandbox::scopedDisable();
357358
FileToRemoveList::removeAllFiles(FilesToRemove);
358359
}
359360

llvm/lib/Support/Windows/Signals.inc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,11 +563,13 @@ static void Cleanup(bool ExecuteSignalHandlers) {
563563
CleanupExecuted = true;
564564

565565
// FIXME: open files cannot be deleted.
566-
if (FilesToRemove != NULL)
566+
if (FilesToRemove != NULL) {
567+
[[maybe_unused]] auto BypassSandbox = sys::sandbox::scopedDisable();
567568
while (!FilesToRemove->empty()) {
568569
llvm::sys::fs::remove(FilesToRemove->back());
569570
FilesToRemove->pop_back();
570571
}
572+
}
571573

572574
if (ExecuteSignalHandlers)
573575
llvm::sys::RunSignalHandlers();

0 commit comments

Comments
 (0)