Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Data race in SentrySwizzleInfo.originalCalled #4434

Merged
merged 3 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ via the option `swizzleClassNameExclude`.
- Add TTID/TTFD spans when loadView gets skipped (#4415)
- Finish TTID correctly when viewWillAppear is skipped (#4417)
- Swizzling RootUIViewController if ignored by `swizzleClassNameExclude` (#4407)
- Data race in SentrySwizzleInfo.originalCalled (#4434)

### Improvements

Expand Down
2 changes: 1 addition & 1 deletion Sources/Sentry/SentrySwizzle.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ - (SentrySwizzleOriginalIMP)getOriginalImplementation
return NULL;
}

#if defined(TEST) || defined(TESTCI) || defined(DEBUG)
#if defined(TEST) || defined(TESTCI)
@synchronized(self) {
self.originalCalled = YES;
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/Sentry/include/HybridPublic/SentrySwizzle.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ typedef void (*SentrySwizzleOriginalIMP)(void /* id, SEL, ... */);
*/
@property (nonatomic, readonly) SEL selector;

#if defined(TEST) || defined(TESTCI) || defined(DEBUG)
#if defined(TEST) || defined(TESTCI)
/**
* A flag to check whether the original implementation was called.
*/
Expand Down Expand Up @@ -367,7 +367,7 @@ typedef NS_ENUM(NSUInteger, SentrySwizzleMode) {
// and remove it later.
#define _SentrySWArguments(arguments...) DEL, ##arguments

#if defined(TEST) || defined(TESTCI) || defined(DEBUG)
#if defined(TEST) || defined(TESTCI)
# define _SentrySWReplacement(code...) \
@try { \
code \
Expand Down
Loading