From 90754df684ad44d5a7a487fb37bc3fcda0532aca Mon Sep 17 00:00:00 2001 From: tknopp Date: Fri, 24 Jan 2014 06:06:26 +0100 Subject: [PATCH] Fix jl_apply_array_type (root boxed dim) --- src/julia.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/julia.h b/src/julia.h index 03870a8cb597b..1602127587964 100644 --- a/src/julia.h +++ b/src/julia.h @@ -817,7 +817,11 @@ DLLEXPORT void *jl_value_ptr(jl_value_t *a); DLLEXPORT void jl_cell_1d_push(jl_array_t *a, jl_value_t *item); STATIC_INLINE jl_value_t *jl_apply_array_type(jl_datatype_t *type, size_t dim) { - return jl_apply_type((jl_value_t*)jl_array_type, jl_tuple2(type, jl_box_long(dim))); + jl_value_t *boxed_dim = jl_box_long(dim); + JL_GC_PUSH1(&boxed_dim); + jl_value_t *ret = jl_apply_type((jl_value_t*)jl_array_type, jl_tuple2(type, boxed_dim)); + JL_GC_POP(); + return ret; } // eq hash tables