Commit c92ddc55 authored by simonmar's avatar simonmar

[project @ 2002-09-06 14:40:28 by simonmar]

Disallow ForeignObj as well as ForeignPtr FFI arguments
parent b3e4cb91
...@@ -829,8 +829,7 @@ legalFEArgTyCon :: TyCon -> Bool ...@@ -829,8 +829,7 @@ legalFEArgTyCon :: TyCon -> Bool
-- bytearrays from a _ccall_ / foreign declaration -- bytearrays from a _ccall_ / foreign declaration
-- (or be passed them as arguments in foreign exported functions). -- (or be passed them as arguments in foreign exported functions).
legalFEArgTyCon tc legalFEArgTyCon tc
| getUnique tc `elem` [ foreignObjTyConKey, | getUnique tc `elem` [ byteArrayTyConKey, mutableByteArrayTyConKey ]
byteArrayTyConKey, mutableByteArrayTyConKey ]
= False = False
-- It's also illegal to make foreign exports that take unboxed -- It's also illegal to make foreign exports that take unboxed
-- arguments. The RTS API currently can't invoke such things. --SDM 7/2000 -- arguments. The RTS API currently can't invoke such things. --SDM 7/2000
...@@ -840,16 +839,14 @@ legalFEArgTyCon tc ...@@ -840,16 +839,14 @@ legalFEArgTyCon tc
legalFIResultTyCon :: DynFlags -> TyCon -> Bool legalFIResultTyCon :: DynFlags -> TyCon -> Bool
legalFIResultTyCon dflags tc legalFIResultTyCon dflags tc
| getUnique tc `elem` | getUnique tc `elem`
[ foreignObjTyConKey, [ byteArrayTyConKey, mutableByteArrayTyConKey ] = False
byteArrayTyConKey, mutableByteArrayTyConKey ] = False
| tc == unitTyCon = True | tc == unitTyCon = True
| otherwise = marshalableTyCon dflags tc | otherwise = marshalableTyCon dflags tc
legalFEResultTyCon :: TyCon -> Bool legalFEResultTyCon :: TyCon -> Bool
legalFEResultTyCon tc legalFEResultTyCon tc
| getUnique tc `elem` | getUnique tc `elem`
[ foreignObjTyConKey, [ byteArrayTyConKey, mutableByteArrayTyConKey ] = False
byteArrayTyConKey, mutableByteArrayTyConKey ] = False
| tc == unitTyCon = True | tc == unitTyCon = True
| otherwise = boxedMarshalableTyCon tc | otherwise = boxedMarshalableTyCon tc
...@@ -872,7 +869,7 @@ boxedMarshalableTyCon tc ...@@ -872,7 +869,7 @@ boxedMarshalableTyCon tc
, word32TyConKey, word64TyConKey , word32TyConKey, word64TyConKey
, floatTyConKey, doubleTyConKey , floatTyConKey, doubleTyConKey
, addrTyConKey, ptrTyConKey, funPtrTyConKey , addrTyConKey, ptrTyConKey, funPtrTyConKey
, charTyConKey, foreignObjTyConKey , charTyConKey
, stablePtrTyConKey , stablePtrTyConKey
, byteArrayTyConKey, mutableByteArrayTyConKey , byteArrayTyConKey, mutableByteArrayTyConKey
, boolTyConKey , boolTyConKey
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment