Skip to content

Commit f67ccf5

Browse files
authored
Unset IFS after its use in set_build_options_for_host (#28811)
If IFS remains set, it may cause compilation errors due to unanticipated replacement of characters in some parameters. Addresses rdar://problem/57927748
1 parent 46bc50d commit f67ccf5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

utils/build-script-impl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,10 +542,14 @@ function set_build_options_for_host() {
542542
esac
543543

544544
if [[ "${DARWIN_SDK_DEPLOYMENT_TARGETS}" != "" ]]; then
545-
local IFS=";"; DARWIN_SDK_DEPLOYMENT_TARGETS=($DARWIN_SDK_DEPLOYMENT_TARGETS)
545+
# IFS is immediately unset after its use to avoid unwanted
546+
# replacement of characters in subsequent lines.
547+
local IFS=";"; DARWIN_SDK_DEPLOYMENT_TARGETS=($DARWIN_SDK_DEPLOYMENT_TARGETS); unset IFS
546548

547549
for target in "${DARWIN_SDK_DEPLOYMENT_TARGETS[@]}"; do
548-
local IFS="-"; triple=($target)
550+
# IFS is immediately unset after its use to avoid unwanted
551+
# replacement of characters in subsequent lines.
552+
local IFS="-"; triple=($target); unset IFS
549553
sdk_target=$(toupper ${triple[0]}_${triple[1]})
550554
swift_cmake_options+=(
551555
"-DSWIFTLIB_DEPLOYMENT_VERSION_${sdk_target}=${triple[2]}"

0 commit comments

Comments
 (0)