• Joachim Breitner's avatar
    Ensure that Literals are in range · 6dfc5ebf
    Joachim Breitner authored
    This commit fixes several bugs related to case expressions
    involving numeric literals which are not in the range of values of
    their (fixed-width, integral) type.
    
    There is a new invariant on Literal: The argument of a MachInt[64]
    or MachWord[64] must lie within the range of the corresponding
    primitive type Int[64]# or Word[64]#, as defined by the target machine.
    This invariant is enforced in mkMachInt[64]/mkMachWord[64] by wrapping
    the argument to the target type's range if necessary.
    
    Test Plan: Test Plan: make slowtest TEST="T9533 T9533b T9533c T10245
    T10246"
    
    Trac issues: #9533, #10245, #10246, #13171
    
    Reviewers: simonmar, simonpj, austin, bgamari, nomeata
    
    Reviewed By: bgamari
    
    Subscribers: thomie, rwbarton
    
    Differential Revision: https://phabricator.haskell.org/D810
    6dfc5ebf
MatchLit.hs 19.1 KB