diff options
author | Ben Gamari <ben@smart-cactus.org> | 2021-11-29 16:12:59 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-12-07 06:27:47 -0500 |
commit | 7d2283b9788fd5a724b41c0902067890059de3ff (patch) | |
tree | 0aab3b160b59007c148e7076753433c9e030697d /compiler/GHC/SysTools | |
parent | 0fe45d4346de72d5cf87a03c1eeedea2e2521a5b (diff) | |
download | haskell-7d2283b9788fd5a724b41c0902067890059de3ff.tar.gz |
compiler: Eliminate accidental loop in GHC.SysTools.BaseDir
As noted in #20757, `GHC.SysTools.BaseDir.findToolDir` previously
contained an loop, which would be triggered in the case that the search
failed.
Closes #20757.
Diffstat (limited to 'compiler/GHC/SysTools')
-rw-r--r-- | compiler/GHC/SysTools/BaseDir.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/GHC/SysTools/BaseDir.hs b/compiler/GHC/SysTools/BaseDir.hs index c0a1fa2cee..5d86ee6925 100644 --- a/compiler/GHC/SysTools/BaseDir.hs +++ b/compiler/GHC/SysTools/BaseDir.hs @@ -196,11 +196,11 @@ findToolDir False top_dir = go 0 (top_dir </> "..") [] InstallationError $ "could not detect mingw toolchain in the following paths: " ++ show tried | otherwise = do let try = path </> "mingw" - let tried = tried ++ [try] + let tried' = tried ++ [try] oneLevel <- doesDirectoryExist try if oneLevel then return (Just path) - else go (k+1) (path </> "..") tried + else go (k+1) (path </> "..") tried' findToolDir True _ = return Nothing #else findToolDir _ _ = return Nothing |