<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<meta content="text/html; charset=US-ASCII" http-equiv="Content-Type">
<title>
GitLab
</title>



<style>img {
max-width: 100%; height: auto;
}
</style>
</head>
<body>
<div class="content">

<h3>
Ben Gamari pushed to branch wip/backports
at <a href="https://gitlab.haskell.org/ghc/ghc">Glasgow Haskell Compiler / GHC</a>
</h3>
<h4>
Commits:
</h4>
<ul>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/8b2e2c5d257f782a548bab043613cea1db06a4fa">8b2e2c5d</a></strong>
<div>
<span>by Ömer Sinan Ağacan</span>
<i>at 2020-05-14T12:31:10-04:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">FastString: fix eager reading of string ptr in hashStr

This read causes NULL dereferencing when len is 0.

Fixes #17909

In the reproducer in #17909 this bug is triggered as follows:

- SimplOpt.dealWithStringLiteral is called with a single-char string
  ("=" in #17909)

- tailFS gets called on the FastString of the single-char string.

- tailFS checks the length of the string, which is 1, and calls
  mkFastStringByteString on the tail of the ByteString, which is an
  empty ByteString as the original ByteString has only one char.

- ByteString's unsafeUseAsCStringLen returns (NULL, 0) for the empty
  ByteString, which is passed to mkFastStringWith.

- mkFastStringWith gets hash of the NULL pointer via hashStr, which
  fails on empty strings because of this bug.

(cherry picked from commit d15b61608a542f6349b42224140b7d227b88ef4e)
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/feabe4bd5b2baf699c13edce3e275b067c8111a9">feabe4bd</a></strong>
<div>
<span>by Simon Peyton Jones</span>
<i>at 2020-05-14T12:34:39-04:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Improve error handling for VTA + deferred type errors

This fixes #17792

See Note [VTA for out-of-scope functions] in TcExpr

(cherry picked from commit 335b18bac3c361d243f427b66e67c2c94f5c6494)
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/fbf280c2cc2b5453014831baafb736f76e34a6b7">fbf280c2</a></strong>
<div>
<span>by Simon Peyton Jones</span>
<i>at 2020-05-14T12:38:20-04:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Add a missing zonk in tcHsPartialType

I omitted a vital zonk when refactoring tcHsPartialType in
   commit 48fb3482f8cbc8a4b37161021e846105f980eed4
   Author: Simon Peyton Jones <simonpj@microsoft.com>
   Date:   Wed Jun 5 08:55:17 2019 +0100

   Fix typechecking of partial type signatures

This patch fixes it and adds commentary to explain why.

Fixes #18008

(cherry picked from commit 658bda511237593bb80389280d0364180648058d)
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/3d9267f2e88f9bab8fa87f454e3402b69f81e50a">3d9267f2</a></strong>
<div>
<span>by Sylvain Henry</span>
<i>at 2020-05-14T12:39:04-04:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Rts: show errno on failure (#18033)

(cherry picked from commit 4875d419ba066e479f7ac07f8b39ebe10c855859)
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/1ad5f9d3a562ad2aeb613b5b64cfa91cc8c10a04">1ad5f9d3</a></strong>
<div>
<span>by Simon Peyton Jones</span>
<i>at 2020-05-14T12:48:31-04:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Major improvements to the specialiser

This patch is joint work of Alexis King and Simon PJ.  It does some
significant refactoring of the type-class specialiser.  Main highlights:

* We can specialise functions with types like
     f :: Eq a => a -> Ord b => b => blah
  where the classes aren't all at the front (#16473).  Here we can
  correctly specialise 'f' based on a call like
     f @Int @Bool dEqInt x dOrdBool
  This change really happened in an earlier patch
     commit 2d0cf6252957b8980d89481ecd0b79891da4b14b
     Author: Sandy Maguire <sandy@sandymaguire.me>
     Date:   Thu May 16 12:12:10 2019 -0400
  work that this new patch builds directly on that work, and refactors
  it a bit.

* We can specialise functions with implicit parameters (#17930)
     g :: (?foo :: Bool, Show a) => a -> String
  Previously we could not, but now they behave just like a non-class
  argument as in 'f' above.

* We can specialise under-saturated calls, where some (but not all of
  the dictionary arguments are provided (#17966).  For example, we can
  specialise the above 'f' based on a call
     map (f @Int dEqInt) xs
  even though we don't (and can't) give Ord dictionary.

  This may sound exotic, but #17966 is a program from the wild, and
  showed significant perf loss for functions like f, if you need
  saturation of all dictionaries.

* We fix a buglet in which a floated dictionary had a bogus demand
  (#17810), by using zapIdDemandInfo in the NonRec case of specBind.

* A tiny side benefit: we can drop dead arguments to specialised
  functions; see Note [Drop dead args from specialisations]

* Fixed a bug in deciding what dictionaries are "interesting"; see
  Note [Keep the old dictionaries interesting]

This is all achieved by by building on Sandy Macguire's work in
defining SpecArg, which mkCallUDs uses to describe the arguments of
the call. Main changes:

* Main work is in specHeader, which marched down the [InBndr] from the
  function definition and the [SpecArg] from the call site, together.

* specCalls no longer has an arity check; the entire mechanism now
  handles unders-saturated calls fine.

* mkCallUDs decides on an argument-by-argument basis whether to
  specialise a particular dictionary argument; this is new.
  See mk_spec_arg in mkCallUDs.

It looks as if there are many more lines of code, but I think that
all the extra lines are comments!

(cherry picked from commit 7052d7c7ce3418db9e66ad6ff31e80b2a2c724bb)
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/0e15cd022d3d094d1e40e866b68deb452dcad4fb">0e15cd02</a></strong>
<div>
<span>by Ryan Scott</span>
<i>at 2020-05-14T12:48:43-04:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Fix two ASSERT buglets in reifyDataCon

Two `ASSERT`s in `reifyDataCon` were always using `arg_tys`, but
`arg_tys` is not meaningful for GADT constructors. In fact, it's
worse than non-meaningful, since using `arg_tys` when reifying a
GADT constructor can lead to failed `ASSERT`ions, as #17305
demonstrates.

This patch applies the simplest possible fix to the immediate
problem. The `ASSERT`s now use `r_arg_tys` instead of `arg_tys`, as
the former makes sure to give something meaningful for GADT
constructors. This makes the panic go away at the very least. There
is still an underlying issue with the way the internals of
`reifyDataCon` work, as described in
https://gitlab.haskell.org/ghc/ghc/issues/17305#note_227023, but we
leave that as future work, since fixing the underlying issue is
much trickier (see
https://gitlab.haskell.org/ghc/ghc/issues/17305#note_227087).

(cherry picked from commit cfb66d181ac45ce3d934bda3521b94277e6eb683)
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/522fb66e44841f89f7bdc5dcfeaa65b47cf77055">522fb66e</a></strong>
<div>
<span>by Adam Gundry</span>
<i>at 2020-05-14T12:50:21-04:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Reject all duplicate declarations involving DuplicateRecordFields (fixes #17965)

This fixes a bug that resulted in some programs being accepted that used the same
identifier as a field label and another declaration, depending on the order they
appeared in the source code.

(cherry picked from commit 0d8c7a6c7c3513089668f49efb0a2dd8b4bbe74a)
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/9e50a1658b91eaa322523252b32e1a59a8afacd2">9e50a165</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-05-14T12:50:34-04:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Ensure that printMinimalImports closes handle

Fixes #18166.

(cherry picked from commit 5afc160dee7142c96a842037fb64bee1429ad9ec)
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/c54556ec1a6864b620d7eafcc10a7f55ac0c69b1">c54556ec</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-05-14T12:50:48-04:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Make non-existent linker search path merely a warning

As noted in #18105, previously this resulted in a rather intrusive error
message. This is in contrast to the general expectation that search
paths are merely places to look, not places that must exist.

Fixes #18105.

(cherry picked from commit 24af9f30681444380c25465f555599da563713cb)
</pre>
</li>
</ul>
<h4>30 changed files:</h4>
<ul>
<li class="file-stats">
<a href="#86d5486039a2ce83db2b33410cc15bb06e8b7132">
compiler/basicTypes/RdrName.hs
</a>
</li>
<li class="file-stats">
<a href="#2851b7e67a48670033907e77d142974964daa069">
compiler/coreSyn/CoreSubst.hs
</a>
</li>
<li class="file-stats">
<a href="#c9f253bc92ffa226506febcfb5ef5e67536616f2">
compiler/coreSyn/CoreUnfold.hs
</a>
</li>
<li class="file-stats">
<a href="#739e7c8c5f5618e9473d5a01d0a50b4c2aa7daa0">
compiler/deSugar/DsBinds.hs
</a>
</li>
<li class="file-stats">
<a href="#3419b48ba29451268a93adc303033d2aabf68179">
compiler/rename/RnNames.hs
</a>
</li>
<li class="file-stats">
<a href="#8e5716cfebabf9b3b1774b148dca4e897301a054">
compiler/specialise/Specialise.hs
</a>
</li>
<li class="file-stats">
<a href="#3668e5951898e1cee434d7e6fb5a139287ebe70d">
compiler/typecheck/TcExpr.hs
</a>
</li>
<li class="file-stats">
<a href="#350c4076427c611b8f14e875a4ca553041c2b847">
compiler/typecheck/TcHsType.hs
</a>
</li>
<li class="file-stats">
<a href="#4f8d5e20ad75b577322cf46f2e146466d905fe43">
compiler/typecheck/TcSplice.hs
</a>
</li>
<li class="file-stats">
<a href="#853e3f0b2adba3af1c88bbccec2b53c4c5532e39">
compiler/utils/FastString.hs
</a>
</li>
<li class="file-stats">
<a href="#9670354b74fe55079feca82e1510129734b46f4f">
rts/linker/PEi386.c
</a>
</li>
<li class="file-stats">
<a href="#ec675bd1dfbb74e562acdc649628789841b48f75">
rts/posix/itimer/Pthread.c
</a>
</li>
<li class="file-stats">
<a href="#858c5afd22318ffad6c8fd21ea982b647d29bc6b">
<span class="new-file">
+
testsuite/tests/overloadedrecflds/should_fail/T17965.hs
</span>
</a>
</li>
<li class="file-stats">
<a href="#114391f4f650386dffeead70a2b604903de8ff0e">
<span class="new-file">
+
testsuite/tests/overloadedrecflds/should_fail/T17965.stderr
</span>
</a>
</li>
<li class="file-stats">
<a href="#a00c124cf8da637072ea4d1a5c4f7999c79aa4aa">
testsuite/tests/overloadedrecflds/should_fail/all.T
</a>
</li>
<li class="file-stats">
<a href="#82f05d8af401750ee96408feb631581681a501eb">
<span class="new-file">
+
testsuite/tests/partial-sigs/should_compile/T18008.hs
</span>
</a>
</li>
<li class="file-stats">
<a href="#8b2d3c7a8cc9e6429a7ecff50ba44d0dfa7ca844">
<span class="new-file">
+
testsuite/tests/partial-sigs/should_compile/T18008.stderr
</span>
</a>
</li>
<li class="file-stats">
<a href="#638bf502d5c9ded68b185325d908464f7da3dcac">
testsuite/tests/partial-sigs/should_compile/all.T
</a>
</li>
<li class="file-stats">
<a href="#b788976ba3555853d385fd1c6246444c972d749f">
testsuite/tests/perf/compiler/T16473.stdout
</a>
</li>
<li class="file-stats">
<a href="#11ca6c36a465280185664c54bed1de3cf206b723">
testsuite/tests/simplCore/should_compile/Makefile
</a>
</li>
<li class="file-stats">
<a href="#699a7cef319506d4397c5c89ec1749a67bc44f15">
<span class="new-file">
+
testsuite/tests/simplCore/should_compile/T17810.hs
</span>
</a>
</li>
<li class="file-stats">
<a href="#e058b4b1c4c25d98dca9acd8fa1abfc98cad6b76">
<span class="new-file">
+
testsuite/tests/simplCore/should_compile/T17810a.hs
</span>
</a>
</li>
<li class="file-stats">
<a href="#43c0f6579da9b204cd0428d01583284f3a664318">
<span class="new-file">
+
testsuite/tests/simplCore/should_compile/T17930.hs
</span>
</a>
</li>
<li class="file-stats">
<a href="#6f10bc7839f7d9c02bcf85ea8c4a1d78c7e24b6b">
<span class="new-file">
+
testsuite/tests/simplCore/should_compile/T17930.stderr
</span>
</a>
</li>
<li class="file-stats">
<a href="#64823618efc680c643e35be19ed0003b17073274">
<span class="new-file">
+
testsuite/tests/simplCore/should_compile/T17966.hs
</span>
</a>
</li>
<li class="file-stats">
<a href="#80069ab3e335f49718f742deb0c488301329eb49">
<span class="new-file">
+
testsuite/tests/simplCore/should_compile/T17966.stdout
</span>
</a>
</li>
<li class="file-stats">
<a href="#fc07c260b75644727a8cdc1af5c861a44d4bfb5e">
testsuite/tests/simplCore/should_compile/all.T
</a>
</li>
<li class="file-stats">
<a href="#3474e9ac695d7ceebc16e593e4828f6fd84db3df">
<span class="new-file">
+
testsuite/tests/simplCore/should_compile/spec004.hs
</span>
</a>
</li>
<li class="file-stats">
<a href="#c114c4cec1a70bccc37179d5c97b4c7d09c7b975">
<span class="new-file">
+
testsuite/tests/simplCore/should_compile/spec004.stderr
</span>
</a>
</li>
<li class="file-stats">
<a href="#04b9f675e37d99fa44409acbc392b8bf28ea2ec0">
<span class="new-file">
+
testsuite/tests/th/T17305.hs
</span>
</a>
</li>
</ul>
<h5>The diff was not included because it is too large.</h5>

</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #777;">

<br>
<a href="https://gitlab.haskell.org/ghc/ghc/-/compare/b9df14c49bd6b70e403559e9a70669cc50d7e2f8...c54556ec1a6864b620d7eafcc10a7f55ac0c69b1">View it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.haskell.org.
If you'd like to receive fewer emails, you can
adjust your notification settings.



</p>
</div>
</body>
</html>