
#15867: STG scope error -------------------------------------+------------------------------------- Reporter: csabahruska | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by csabahruska: Old description:
StgRhsClosure can contain duplicated names in its free variable and argument list.
Example bug: libraries/integer-gmp/src/GHC/Integer/Type.hs
GHC HEAD and 8.2.2 has this issue.
I have not checked with other versions.
I've extended the STG linter to do scope checking. See the patch attached.
To reproduce: * patch GHC head: `git apply StgScopeCheck.patch` * make sure every compiled stg is linted: add `-dstg-lint` to GhcStage2HcOpts GhcLibHcOpts GhcRtsHcOpts config vars * compile GHC HEAD
Background info: I've found this issue because I'm using GHC as a Haskell fronted for my whole program compiler project. I work on The GRIN Compiler (https://github.com/grin-tech) where GHC/GRIN compiles STG to GRIN.
New description: StgRhsClosure can contain duplicated names in its free variable and argument list. Example bug: libraries/integer-gmp/src/GHC/Integer/Type.hs GHC HEAD and 8.2.2 has this issue. I have not checked with other versions. I've extended the STG linter to do scope checking. See the patch attached. To reproduce: * patch GHC head: `git apply StgScopeCheck.patch` * make sure every compiled stg is linted: add the following to `mk/build.mk`\\ {{{ GhcStage2HcOpts += -dstg-lint GhcLibHcOpts += -dstg-lint GhcRtsHcOpts += -dstg-lint }}} * compile GHC HEAD Background info: I've found this issue because I'm using GHC as a Haskell fronted for my whole program compiler project. I work on The GRIN Compiler (https://github.com/grin-tech) where GHC/GRIN compiles STG to GRIN. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15867#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler