mirror of
https://github.com/grin-compiler/grin.git
synced 2024-10-03 19:17:42 +03:00
Fix ffi linking for primops in interpreter
No need to try and use libffi with primops as they are defined in haskell in PureEvalPlugin
This commit is contained in:
parent
0ac74dc2da
commit
8ac99ab4a7
@ -185,7 +185,9 @@ evalExp env = \case
|
||||
|
||||
createForeignFns :: [External] -> Map Name (FunPtr ()) -> IO (Map Name (FunPtr ()))
|
||||
createForeignFns [] acc = pure acc
|
||||
createForeignFns exts@(ext : _) acc = case find (\(os, _) -> toString os == Info.os) (eLibs ext) of
|
||||
createForeignFns exts@(ext : _) acc
|
||||
| eKind ext == PrimOp = createForeignFns (tail exts) acc
|
||||
| otherwise = case find (\(os, _) -> toString os == Info.os) (eLibs ext) of
|
||||
Nothing -> do
|
||||
ptr <- dlsym Default $ Text.unpack $ unNM $ eName ext
|
||||
createForeignFns (tail exts) $ Map.insert (eName ext) ptr acc
|
||||
|
Loading…
Reference in New Issue
Block a user