From 4191feedafd5ffce632d33ad534d046a4766057a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Thu, 10 Mar 2016 10:09:34 -0500 Subject: [PATCH 1/1] niti FFI: do not attempt to run extern methods returning a non-primitive type MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- .../dynamic_loading_ffi/on_demand_compiler.nit | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/interpreter/dynamic_loading_ffi/on_demand_compiler.nit b/src/interpreter/dynamic_loading_ffi/on_demand_compiler.nit index f839d3a..e41e743 100644 --- a/src/interpreter/dynamic_loading_ffi/on_demand_compiler.nit +++ b/src/interpreter/dynamic_loading_ffi/on_demand_compiler.nit @@ -35,12 +35,16 @@ redef class AMethPropdef n_extern_code_block.is_c) then return false for mparam in mpropdef.msignature.mparameters do - var mtype = mparam.mtype - if not mtype.is_cprimitive then + if not mparam.mtype.is_cprimitive then return false end end + var return_mtype = mpropdef.msignature.return_mtype + if return_mtype != null and not return_mtype.is_cprimitive then + return false + end + return true end end -- 1.7.9.5