[commit: ghc] wip/rwbarton-biniface: Ensure that Literals are in range (eef5da0)

git at git.haskell.org git at git.haskell.org
Mon Feb 20 05:30:54 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/rwbarton-biniface
Link       : http://ghc.haskell.org/trac/ghc/changeset/eef5da0eda84707af0780732d810f0fdd86e6ee2/ghc

>---------------------------------------------------------------

commit eef5da0eda84707af0780732d810f0fdd86e6ee2
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Thu Feb 9 15:28:54 2017 -0500

    Ensure that Literals are in range
    
    Summary: 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: make slowtest TEST="T9533 T9533b T9533c T10245 T10246"
    
    Reviewers: simonmar, simonpj, austin, bgamari, nomeata
    
    Subscribers: thomie, rwbarton
    
    Differential Revision: https://phabricator.haskell.org/D810
    
    GHC Trac Issues: #9533, #10245, #10246, #13171


>---------------------------------------------------------------

eef5da0eda84707af0780732d810f0fdd86e6ee2
 compiler/basicTypes/Literal.hs                     | 81 +++++++++++++++++-----
 compiler/deSugar/Match.hs                          | 45 ++++++++++--
 compiler/deSugar/MatchLit.hs                       | 43 +++++-------
 compiler/simplCore/SimplUtils.hs                   |  3 +-
 testsuite/tests/codeGen/should_run/T9533.hs        | 13 ++++
 .../should_run/T9533.stdout}                       |  0
 testsuite/tests/codeGen/should_run/T9533b.hs       |  8 +++
 testsuite/tests/codeGen/should_run/T9533b.stdout   |  1 +
 testsuite/tests/codeGen/should_run/T9533c.hs       |  8 +++
 .../should_run/T9533c.stdout}                      |  0
 testsuite/tests/codeGen/should_run/all.T           |  7 +-
 11 files changed, 157 insertions(+), 52 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc eef5da0eda84707af0780732d810f0fdd86e6ee2


More information about the ghc-commits mailing list