Skip to content

Commit 410aca5

Browse files
authored
fix: Fix xcode 26 (#5386)
1 parent 355780b commit 410aca5

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- Crashes for uncaught NSExceptions will now report the stracktrace recorded within the exception (#5306)
1313
- Fix usage of `@available` to be `iOS` instead of `iOSApplicationExtension` (#5361)
1414
- Move SentryExperimentalOptions to a property defined in Swift (#5329)
15+
- Fix building with Xcode 26 (#5386)
1516

1617
## 8.52.1
1718

Sources/SentryCrash/Recording/Tools/SentryCrashCxaThrowSwapper.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,19 +134,19 @@ addPair(SentryCrashImageToOriginalCxaThrowPair pair)
134134
static void
135135
__cxa_throw_decorator(void *thrown_exception, void *tinfo, void (*dest)(void *))
136136
{
137-
const int k_requiredFrames = 2;
137+
#define REQUIRED_FRAMES 2
138138

139139
if (g_cxa_throw_handler != NULL) {
140140
SENTRY_ASYNC_SAFE_LOG_DEBUG(
141141
"Not calling __cxa_throw decorator, because no g_cxa_throw_handler set.");
142142
g_cxa_throw_handler(thrown_exception, tinfo, dest);
143143
}
144144

145-
void *backtraceArr[k_requiredFrames];
146-
int count = backtrace(backtraceArr, k_requiredFrames);
145+
void *backtraceArr[REQUIRED_FRAMES];
146+
int count = backtrace(backtraceArr, REQUIRED_FRAMES);
147147

148148
Dl_info info;
149-
if (count < k_requiredFrames) {
149+
if (count < REQUIRED_FRAMES) {
150150
// This can happen if the throw happened in a signal handler. This is an edge case we ignore
151151
// for now. It can also happen with concurrency frameworks for which backtrace does not work
152152
// reliably, such as Swift async. It can be that we have to use backtrace_async which uses
@@ -160,7 +160,7 @@ __cxa_throw_decorator(void *thrown_exception, void *tinfo, void (*dest)(void *))
160160
return;
161161
}
162162

163-
if (dladdr(backtraceArr[k_requiredFrames - 1], &info) == 0) {
163+
if (dladdr(backtraceArr[REQUIRED_FRAMES - 1], &info) == 0) {
164164
SENTRY_ASYNC_SAFE_LOG_ERROR(
165165
"dladdr failed for throwsite. Can't identify image of throwsite.");
166166
return;

Sources/SentryCrash/Recording/Tools/SentryCrashMachineContext.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ void sentrycrashmc_resumeEnvironment(thread_act_array_t threads, mach_msg_type_n
6565
* @param NAME The C identifier to give the pointer.
6666
*/
6767
#define SentryCrashMC_NEW_CONTEXT(NAME) \
68-
char sentrycrashmc_##NAME##_storage[sentrycrashmc_contextSize]; \
68+
char sentrycrashmc_##NAME##_storage[sizeof(SentryCrashMachineContext)]; \
6969
struct SentryCrashMachineContext *NAME \
7070
= (struct SentryCrashMachineContext *)sentrycrashmc_##NAME##_storage
7171

Sources/SentryCrash/Recording/Tools/SentryCrashMachineContext_Apple.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ typedef struct SentryCrashMachineContext {
5454
STRUCT_MCONTEXT_L machineContext;
5555
} SentryCrashMachineContext;
5656

57-
static const size_t sentrycrashmc_contextSize = sizeof(SentryCrashMachineContext);
58-
5957
#ifdef __cplusplus
6058
}
6159
#endif

0 commit comments

Comments
 (0)