File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -354,7 +354,6 @@ void sys::unregisterHandlers() {
354354
355355// / Process the FilesToRemove list.
356356static void RemoveFilesToRemove () {
357- [[maybe_unused]] auto BypassSandbox = sys::sandbox::scopedDisable ();
358357 FileToRemoveList::removeAllFiles (FilesToRemove);
359358}
360359
@@ -443,7 +442,11 @@ static void InfoSignalHandler(int Sig) {
443442 CurrentInfoFunction ();
444443}
445444
446- void llvm::sys::RunInterruptHandlers () { RemoveFilesToRemove (); }
445+ void sys::RunInterruptHandlers () {
446+ [[maybe_unused]] auto BypassSandbox = sandbox::scopedDisable ();
447+
448+ RemoveFilesToRemove ();
449+ }
447450
448451void llvm::sys::SetInterruptFunction (void (*IF)()) {
449452 InterruptFunction.exchange (IF);
Original file line number Diff line number Diff line change @@ -563,13 +563,11 @@ static void Cleanup(bool ExecuteSignalHandlers) {
563563 CleanupExecuted = true ;
564564
565565 // FIXME: open files cannot be deleted.
566- if (FilesToRemove != NULL ) {
567- [[maybe_unused]] auto BypassSandbox = sys::sandbox::scopedDisable ();
566+ if (FilesToRemove != NULL )
568567 while (!FilesToRemove->empty ()) {
569568 llvm::sys::fs::remove (FilesToRemove->back ());
570569 FilesToRemove->pop_back ();
571570 }
572- }
573571
574572 if (ExecuteSignalHandlers)
575573 llvm::sys::RunSignalHandlers ();
@@ -578,6 +576,8 @@ static void Cleanup(bool ExecuteSignalHandlers) {
578576}
579577
580578void llvm::sys::RunInterruptHandlers () {
579+ [[maybe_unused]] auto BypassSandbox = sandbox::scopedDisable ();
580+
581581 // The interrupt handler may be called from an interrupt, but it may also be
582582 // called manually (such as the case of report_fatal_error with no registered
583583 // error handler). We must ensure that the critical section is properly
You can’t perform that action at this time.
0 commit comments