Skip to content

Commit ce11121

Browse files
committed
[Runtime] Fix guards around _swift_isBackDeploying call in SwiftObject.mm.
This could fail to build due to BackDeployment.h not always being included in Config.h. Check an additional condition to ensure that this code is only active when BackDeployment.h is included. rdar://problem/56735154
1 parent 33dfb94 commit ce11121

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

include/swift/Runtime/Config.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@
160160
# else
161161
# define SWIFT_CLASS_IS_SWIFT_MASK _swift_classIsSwiftMask
162162
# define SWIFT_CLASS_IS_SWIFT_MASK_GLOBAL_VARIABLE 1
163+
# define SWIFT_BUILD_HAS_BACK_DEPLOYMENT 1
163164
# include "BackDeployment.h"
164165

165166
# endif

stdlib/public/runtime/SwiftObject.mm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,10 @@ + (void)initialize {
201201
// runs on older OSes in certain testing scenarios, so that doesn't matter.
202202
// Only perform the check on newer OSes where the value should definitely
203203
// match.
204-
if (!_swift_isBackDeploying()) {
204+
# if SWIFT_BUILD_HAS_BACK_DEPLOYMENT
205+
if (!_swift_isBackDeploying())
206+
# endif
207+
{
205208
assert(&objc_debug_isa_class_mask);
206209
assert(objc_debug_isa_class_mask == SWIFT_ISA_MASK);
207210
}

0 commit comments

Comments
 (0)