Trac #9878: Make the static form illegal in interpreted mode.
authorAlexander Vershilov <alexander.vershilov@tweag.io>
Wed, 14 Jan 2015 23:58:30 +0000 (17:58 -0600)
committerAustin Seipp <austin@well-typed.com>
Fri, 16 Jan 2015 16:15:45 +0000 (10:15 -0600)
commitfffbf0627c2c2ee4bc49f9d26a226b39a066945e
treea3f74945126cef5faa1c28f524097a20ac5d4cd5
parent6392df07e89304a4daeb1af379c051b03a39cda7
Trac #9878: Make the static form illegal in interpreted mode.

Summary:
The entries of the static pointers table are expected to exist as
object code. Thus we have ghci complain with an intelligible error
message if the static form is used in interpreted mode.

It also includes a fix to keysHashTable in Hash.c which could cause a
crash. The iteration of the hashtable internals was incorrect. This
patch has the function keysHashTable imitate the iteration in
freeHashTable.

Finally, we submit here some minor edits to comments and
GHC.StaticPtr.StaticPtrInfo field names.

Authored-by: Alexander Vershilov <alexander.vershilov@tweag.
Authored-by: Facundo Domínguez <facundo.dominguez@tweag.io>
Test Plan: ./validate

Reviewers: simonpj, hvr, austin

Reviewed By: austin

Subscribers: carter, thomie, qnikst, mboes

Differential Revision: https://phabricator.haskell.org/D586

GHC Trac Issues: #9878
12 files changed:
compiler/deSugar/DsExpr.hs
compiler/rename/RnExpr.hs
includes/rts/StaticPtrTable.h
libraries/base/GHC/StaticPtr.hs
rts/Hash.c
testsuite/tests/deSugar/should_run/DsStaticPointers.stdout
testsuite/tests/ghci/scripts/T9878.hs [new file with mode: 0644]
testsuite/tests/ghci/scripts/T9878.script [new file with mode: 0644]
testsuite/tests/ghci/scripts/T9878.stderr [new file with mode: 0644]
testsuite/tests/ghci/scripts/T9878b.script [new file with mode: 0644]
testsuite/tests/ghci/scripts/T9878b.stdout [new file with mode: 0644]
testsuite/tests/ghci/scripts/all.T