[commit: ghc] wip/rwbarton-biniface: Ensure that Literals are in range (c63b2dc)
git at git.haskell.org
git at git.haskell.org
Mon Feb 20 01:06:35 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/rwbarton-biniface
Link : http://ghc.haskell.org/trac/ghc/changeset/c63b2dc9cf9d09788d64de48f07f9640aac2a3fe/ghc
>---------------------------------------------------------------
commit c63b2dc9cf9d09788d64de48f07f9640aac2a3fe
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
>---------------------------------------------------------------
c63b2dc9cf9d09788d64de48f07f9640aac2a3fe
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 c63b2dc9cf9d09788d64de48f07f9640aac2a3fe
More information about the ghc-commits
mailing list