[GHC] #9413: Outputable instance for Unique sometimes generates null bytes

GHC ghc-devs at haskell.org
Thu Aug 7 13:09:54 UTC 2014


#9413: Outputable instance for Unique sometimes generates null bytes
-------------------------------------+-------------------------------------
              Reporter:  ezyang      |            Owner:
                  Type:  bug         |           Status:  new
              Priority:  normal      |        Milestone:
             Component:  Compiler    |          Version:  7.9
            Resolution:              |         Keywords:
      Operating System:              |     Architecture:  Unknown/Multiple
  Unknown/Multiple                   |       Difficulty:  Unknown
       Type of failure:  Other       |       Blocked By:
             Test Case:              |  Related Tickets:
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------

Comment (by Edward Z. Yang <ezyang@…>):

 In [changeset:"4855be0d0d1ac90f836a6fb54f4034f478e38fd8/ghc"]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="4855be0d0d1ac90f836a6fb54f4034f478e38fd8"
 Give the Unique generated by strings a tag '$', fixes #9413.

 Summary:
 Previously, we allocated uniques for strings starting at zero, which
 means the tag bits in the unique are zero, which means that printing a
 Unique for a string will start with a null byte.  This is bad.  So
 instead, start our numbering with the tag byte as '$' (as in $tring).
 This is hard coded so we don't have to worry about the optimizer
 reducing the expression.

 Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu>

 Test Plan: validate

 Reviewers: hvr, simonmar, austin

 Subscribers: simonmar, relrod, ezyang, carter

 Differential Revision: https://phabricator.haskell.org/D123

 GHC Trac Issues: #9413
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9413#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list