[Git][ghc/ghc][wip/romes/12935] Fix bug caused by ignoring namespace w det uniqus

Rodrigo Mesquita (@alt-romes) gitlab at gitlab.haskell.org
Tue Jul 2 15:40:19 UTC 2024



Rodrigo Mesquita pushed to branch wip/romes/12935 at Glasgow Haskell Compiler / GHC


Commits:
fde0cc55 by Rodrigo Mesquita at 2024-07-02T16:40:04+01:00
Fix bug caused by ignoring namespace w det uniqus

- - - - -


1 changed file:

- compiler/GHC/Cmm/UniqueRenamer.hs


Changes:

=====================================
compiler/GHC/Cmm/UniqueRenamer.hs
=====================================
@@ -328,9 +328,19 @@ takeUniqueFromDSupply d =
   case unUDSM getUniqueDSM d of
     DUniqResult x y -> (x, y)
 
+-- Write Note about the importance of locality in uniques that are deterministic
+--
+-- If you use a tag which collides with other names, you'll get a uniques
+-- deterministically colliding with existing symbols.
+--
+-- (e.g. easy to observe if you do this wrong)
+--
+-- Ideally, we'd thread the same deterministic unique supply all the way
+-- throughout the Cmm pipeline, starting off from hte deterministic rename
+-- pass.
 initDUniqSupply :: Char -> Word64 -> DUniqSupply
 initDUniqSupply c firstUniq =
-  let !tag = mkTag 'Q' {- TODO: c -}
+  let !tag = mkTag c
   in DUS (tag .|. firstUniq)
 
 newTagDUniqSupply :: Char -> DUniqSupply -> DUniqSupply



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/fde0cc552c5ec71578fec940986fbd11802d8666

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/fde0cc552c5ec71578fec940986fbd11802d8666
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240702/e976fa96/attachment-0001.html>


More information about the ghc-commits mailing list