From: Jérémie Astor Date: Mon, 6 Sep 2021 14:48:10 +0000 (+0200) Subject: :bug: Check array contains object before emitting null check X-Git-Tag: nightly~470^2~3 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=59ac0061bdf8c242fa8e6d014e43c641747ac824;p=gwion.git :bug: Check array contains object before emitting null check --- 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);