[GHC] #9122: Make Lint check for bad uses of `unsafeCoerce`

GHC ghc-devs at haskell.org
Fri Jan 30 08:44:39 UTC 2015


#9122: Make Lint check for bad uses of `unsafeCoerce`
-------------------------------------+-------------------------------------
        Reporter:  simonpj           |                   Owner:  qnikst
            Type:  bug               |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  Compiler          |                 Version:  7.8.2
      Resolution:                    |                Keywords:  newcomer
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  None/Unknown      |  Unknown/Multiple
      Blocked By:                    |               Test Case:
 Related Tickets:                    |                Blocking:
                                     |  Differential Revisions:  Phab:D637
-------------------------------------+-------------------------------------

Comment (by qnikst):

 I want to clarify following questions about required semantics:

 1. Coercion between unboxed types of different sizes
  Do we want to check _real_ (word aligned size of values) or _active_
 (i.e. number of significant bytes)? (On Phab I assumed latter).
  But what about UnboxedTuples it seems that checking active size is not
 totally correct there?

 2. Coercion between unboxed ints and floats.
  I see one usecase for such coercions, for example we have an array of
 floats, or unboxed tuple, and
  we want to calculate checksum, then we want to treat that array as an
 array of other base type.
  What should we do around unboxed tuples in this check? (On Phab I
 disabled check for unboxed tuples)

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


More information about the ghc-tickets mailing list