Skip to content

Commit a6988aa

Browse files
committed
Fix logic error pointed out by Vitaly
1 parent 625f812 commit a6988aa

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,12 @@ static void KeepUnblocked(__sanitizer_sigset_t &newset,
177177

178178
// Block asynchronous signals
179179
void BlockSignals(__sanitizer_sigset_t *oldset) {
180-
# if SANITIZER_LINUX
181-
__sanitizer_sigset_t currentset;
182-
183180
__sanitizer_sigset_t newset;
184181
internal_sigfillset(&newset);
185182

183+
# if SANITIZER_LINUX
184+
__sanitizer_sigset_t currentset;
185+
186186
# if !SANITIZER_ANDROID
187187
// FIXME: https://github.com/google/sanitizers/issues/1816
188188
SetSigProcMask(NULL, &currentset);
@@ -211,8 +211,9 @@ void BlockSignals(__sanitizer_sigset_t *oldset) {
211211
KeepUnblocked(newset, currentset, SIGPIPE);
212212
# endif //! SANITIZER_ANDROID
213213

214-
SetSigProcMask(&newset, oldset);
215214
# endif // SANITIZER_LINUX
215+
216+
SetSigProcMask(&newset, oldset);
216217
}
217218

218219
ScopedBlockSignals::ScopedBlockSignals(__sanitizer_sigset_t *copy) {

0 commit comments

Comments
 (0)