File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed
stdlib/public/Concurrency Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -352,12 +352,20 @@ bool swift_bincompat_useLegacyNonCrashingExecutorChecks() {
352
352
353
353
// Potentially, override the platform detected mode, primarily used in tests.
354
354
#if SWIFT_STDLIB_HAS_ENVIRON
355
- if (const char *modeStr = runtime::environment::
356
- concurrencyIsCurrentExecutorLegacyModeOverride ()) {
357
- if (strcmp (modeStr, " nocrash" ) == 0 || strcmp (modeStr, " legacy" ) == 0 ) {
358
- return true ;
359
- } else if (strcmp (modeStr, " crash" ) == 0 || strcmp (modeStr, " swift6" ) == 0 ) {
360
- return false ; // don't use the legacy mode
355
+
356
+ #if SWIFT_CONCURRENCY_EMBEDDED
357
+ const char *modeStr =
358
+ runtime::environment::concurrencyIsCurrentExecutorLegacyModeOverride ();
359
+ #else
360
+ // embedded does not have a runtime to read env variables from; ignore overrides
361
+ const char *modeStr = nullptr ;
362
+ #endif // SWIFT_CONCURRENCY_EMBEDDED
363
+
364
+ if (modeStr) {
365
+ if (strcmp (modeStr, " nocrash" ) == 0 ) {
366
+ useLegacyMode = true ;
367
+ } else if (strcmp (modeStr, " crash" ) == 0 ) {
368
+ useLegacyMode = false ;
361
369
} // else, just use the platform detected mode
362
370
} // no override, use the default mode
363
371
#endif // SWIFT_STDLIB_HAS_ENVIRON
You can’t perform that action at this time.
0 commit comments