From 81486f92dfcbdd6e840dcc46b2abcf07f2acde21 Mon Sep 17 00:00:00 2001 From: Ian-Woo Kim Date: Sun, 27 Aug 2023 19:32:40 -0700 Subject: [PATCH] calling std::function should be safe! --- fficxx-runtime/src/FFICXX/Runtime/Function/TH.hs | 4 ++-- fficxx-test/fficxx-test.cabal | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fficxx-runtime/src/FFICXX/Runtime/Function/TH.hs b/fficxx-runtime/src/FFICXX/Runtime/Function/TH.hs index e331799f..565a833c 100644 --- a/fficxx-runtime/src/FFICXX/Runtime/Function/TH.hs +++ b/fficxx-runtime/src/FFICXX/Runtime/Function/TH.hs @@ -75,8 +75,8 @@ genFunctionInstanceFor qtyp param = let suffix = fpinfoSuffix param typ <- qtyp f1 <- mkNew "newFunction" t_newFunction typ suffix - -- TODO: handle safety correctly - f2 <- mkMember "call" (t_call FFIUnsafe) typ suffix + -- NOTE: The indirected function call should be safe. + f2 <- mkMember "call" (t_call FFISafe) typ suffix f3 <- mkDelete "deleteFunction" t_deleteFunction typ suffix wrap <- mkWrapper (typ, suffix) addModFinalizer diff --git a/fficxx-test/fficxx-test.cabal b/fficxx-test/fficxx-test.cabal index 4362c0ca..9fbb059d 100644 --- a/fficxx-test/fficxx-test.cabal +++ b/fficxx-test/fficxx-test.cabal @@ -1,6 +1,6 @@ Cabal-Version: 3.0 Name: fficxx-test -Version: 0.7.0.1 +Version: 0.8.0.0 Synopsis: test for fficxx Description: test for fficxx (with stdcxx) License: BSD-2-Clause