niti FFI: do not attempt to run extern methods returning a non-primitive type
authorAlexis Laferrière <alexis.laf@xymus.net>
Thu, 10 Mar 2016 15:09:34 +0000 (10:09 -0500)
committerAlexis Laferrière <alexis.laf@xymus.net>
Thu, 10 Mar 2016 15:57:25 +0000 (10:57 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

src/interpreter/dynamic_loading_ffi/on_demand_compiler.nit

index f839d3a..e41e743 100644 (file)
@@ -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