Skip to content

Commit 300bd98

Browse files
authored
Merge pull request #39953 from apple/jgrynspan/84739108-symbol-list
Amend _swift_stdlib_getCurrentStackBounds() to do nothing when SWIFT_STDLIB_SINGLE_THREADED_RUNTIME is defined.
2 parents cd610b8 + 35ea326 commit 300bd98

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

stdlib/public/stubs/Stubs.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,12 @@ __swift_bool swift_stdlib_isStackAllocationSafe(__swift_size_t byteCount,
506506

507507
__swift_bool _swift_stdlib_getCurrentStackBounds(__swift_uintptr_t *outBegin,
508508
__swift_uintptr_t *outEnd) {
509-
#if defined(__APPLE__)
509+
#if defined(SWIFT_STDLIB_SINGLE_THREADED_RUNTIME)
510+
// This platform does not support threads, so the API we'd call to get stack
511+
// bounds (i.e. libpthread) is not going to be usable.
512+
return false;
513+
514+
#elif defined(__APPLE__)
510515
pthread_t thread = pthread_self();
511516
// On Apple platforms, the stack grows down, so that the end of the stack
512517
// comes before the beginning on the number line, and an address on the stack

0 commit comments

Comments
 (0)