File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
stdlib/public/Concurrency Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -351,15 +351,16 @@ static void checkIsCurrentExecutorMode(void *context) {
351
351
352
352
// Potentially, override the platform detected mode, primarily used in tests.
353
353
#if SWIFT_STDLIB_HAS_ENVIRON
354
- const char *modeStr = getenv (" SWIFT_IS_CURRENT_EXECUTOR_LEGACY_MODE_OVERRIDE" );
355
- if (!modeStr)
356
- return ;
357
-
358
- if (strcmp (modeStr, " nocrash" ) == 0 ) {
359
- useLegacyMode = Legacy_NoCheckIsolated_NonCrashing;
360
- } else if (strcmp (modeStr, " crash" ) == 0 ) {
361
- useLegacyMode = Default_UseCheckIsolated_AllowCrash;
362
- } // else, just use the platform detected mode
354
+ if (const char *modeStr =
355
+ getenv (" SWIFT_IS_CURRENT_EXECUTOR_LEGACY_MODE_OVERRIDE" )) {
356
+ if (modeStr && *modeStr) {
357
+ if (strcmp (modeStr, " nocrash" ) == 0 ) {
358
+ useLegacyMode = true ;
359
+ } else if (strcmp (modeStr, " crash" ) == 0 ) {
360
+ useLegacyMode = false ;
361
+ } // else, just use the platform detected mode
362
+ }
363
+ }
363
364
#endif // SWIFT_STDLIB_HAS_ENVIRON
364
365
isCurrentExecutorMode = useLegacyMode ? Legacy_NoCheckIsolated_NonCrashing
365
366
: Default_UseCheckIsolated_AllowCrash;
You can’t perform that action at this time.
0 commit comments