From 351d897c9886aee9bdc24929ca25facaa27821dd Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Thu, 21 May 2015 10:31:25 -0400 Subject: [PATCH] compilers: missing argument unboxing with new nativearray Signed-off-by: Jean Privat --- src/compiler/global_compiler.nit | 1 + src/compiler/separate_compiler.nit | 1 + 2 files changed, 2 insertions(+) diff --git a/src/compiler/global_compiler.nit b/src/compiler/global_compiler.nit index ede1beb..b2cf479 100644 --- a/src/compiler/global_compiler.nit +++ b/src/compiler/global_compiler.nit @@ -404,6 +404,7 @@ class GlobalCompilerVisitor do var ret_type = mmodule.native_array_type(elttype) ret_type = anchor(ret_type).as(MClassType) + length = autobox(length, compiler.mainmodule.int_type) return self.new_expr("NEW_{ret_type.c_name}({length})", ret_type) end diff --git a/src/compiler/separate_compiler.nit b/src/compiler/separate_compiler.nit index 3e7fbcb..085a36d 100644 --- a/src/compiler/separate_compiler.nit +++ b/src/compiler/separate_compiler.nit @@ -2032,6 +2032,7 @@ class SeparateCompilerVisitor self.require_declaration("NEW_{mtype.mclass.c_name}") assert mtype isa MGenericType var compiler = self.compiler + length = autobox(length, compiler.mainmodule.int_type) if mtype.need_anchor then hardening_live_open_type(mtype) link_unresolved_type(self.frame.mpropdef.mclassdef, mtype) -- 1.7.9.5