[GHC] #5664: Missing checks for FFI declaration types
GHC
cvs-ghc at haskell.org
Wed Apr 4 11:32:59 CEST 2012
#5664: Missing checks for FFI declaration types
---------------------------------+------------------------------------------
Reporter: simonmar | Owner: pcapriotti
Type: bug | Status: patch
Priority: normal | Milestone: 7.6.1
Component: Compiler (FFI) | Version: 7.2.1
Keywords: | Os: Unknown/Multiple
Architecture: Unknown/Multiple | Failure: GHC accepts invalid program
Difficulty: Unknown | Testcase:
Blockedby: | Blocking:
Related: |
---------------------------------+------------------------------------------
Comment(by simonpj):
Thanks. Looks right to me, but it took me a while to be sure.
Suggestions for comments to make it easier:
* Needs a `Note [blah]` with an example in `isFFIDynTy`.
* Comment on `isFFIDynTy` mentions `Addr` but code does not?
* The comment on `isFFIDynTy` should say what the two argument types are,
linked to your example. It took me a while to understand what the
`curried_res_ty` was doing, until I realised that `arg_tys` was all the
args ''except'' the `FunPtr`.
* The comment says that the check is modulo newtypes, but
`splitTyConApp_maybe` does not look through newtypes, so I thought it was
wrong. But it's ok because we have previously called `normaliseFfiType`.
Worth a comment to point this out, as is done in `TcForeign` line 366, for
example.
Please push, and add a test. Thanks!
Simon
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5664#comment:6>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list