Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
c92ddc55
Commit
c92ddc55
authored
Sep 06, 2002
by
simonmar
Browse files
[project @ 2002-09-06 14:40:28 by simonmar]
Disallow ForeignObj as well as ForeignPtr FFI arguments
parent
b3e4cb91
Changes
1
Hide whitespace changes
Inline
Side-by-side
ghc/compiler/typecheck/TcType.lhs
View file @
c92ddc55
...
...
@@ -829,8 +829,7 @@ legalFEArgTyCon :: TyCon -> Bool
-- bytearrays from a _ccall_ / foreign declaration
-- (or be passed them as arguments in foreign exported functions).
legalFEArgTyCon tc
| getUnique tc `elem` [ foreignObjTyConKey,
byteArrayTyConKey, mutableByteArrayTyConKey ]
| getUnique tc `elem` [ byteArrayTyConKey, mutableByteArrayTyConKey ]
= False
-- It's also illegal to make foreign exports that take unboxed
-- arguments. The RTS API currently can't invoke such things. --SDM 7/2000
...
...
@@ -840,16 +839,14 @@ legalFEArgTyCon tc
legalFIResultTyCon :: DynFlags -> TyCon -> Bool
legalFIResultTyCon dflags tc
| getUnique tc `elem`
[ foreignObjTyConKey,
byteArrayTyConKey, mutableByteArrayTyConKey ] = False
[ byteArrayTyConKey, mutableByteArrayTyConKey ] = False
| tc == unitTyCon = True
| otherwise = marshalableTyCon dflags tc
legalFEResultTyCon :: TyCon -> Bool
legalFEResultTyCon tc
| getUnique tc `elem`
[ foreignObjTyConKey,
byteArrayTyConKey, mutableByteArrayTyConKey ] = False
[ byteArrayTyConKey, mutableByteArrayTyConKey ] = False
| tc == unitTyCon = True
| otherwise = boxedMarshalableTyCon tc
...
...
@@ -872,7 +869,7 @@ boxedMarshalableTyCon tc
, word32TyConKey, word64TyConKey
, floatTyConKey, doubleTyConKey
, addrTyConKey, ptrTyConKey, funPtrTyConKey
, charTyConKey
, foreignObjTyConKey
, charTyConKey
, stablePtrTyConKey
, byteArrayTyConKey, mutableByteArrayTyConKey
, boolTyConKey
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment