From 59ac0061bdf8c242fa8e6d014e43c641747ac824 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Mon, 6 Sep 2021 16:48:10 +0200 Subject: [PATCH] :bug: Check array contains object before emitting null check --- src/lib/array.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lib/array.c b/src/lib/array.c index 0bd3558b..954a9db5 100644 --- a/src/lib/array.c +++ b/src/lib/array.c @@ -324,8 +324,7 @@ ANN static void array_loop(const Emitter emit, const m_uint depth) { ANN static void array_finish(const Emitter emit, const m_uint depth, const Type t, const m_bool is_var) { const Instr get = emit_add_instr(emit, is_var ? ArrayAddr : ArrayGet); - // determine if we have an object here - if(!is_var) { + if(!is_var && isa(t, emit->gwion->type[et_object]) > 0) { const m_uint _depth = get_depth(t); if(_depth < depth || isa(array_base(t), emit->gwion->type[et_object]) > 0) emit_add_instr(emit, GWOP_EXCEPT); -- 2.43.0