From: fennecdjay Date: Tue, 15 Oct 2019 21:25:03 +0000 (+0200) Subject: :gun: Mark function unpure as soon as you emit object X-Git-Tag: nightly~2130 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=f793a54248e75a529e0780f2a99dd6ff82119674;p=gwion.git :gun: Mark function unpure as soon as you emit object --- diff --git a/src/emit/emit.c b/src/emit/emit.c index a0999059..7e7ab4f9 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -245,6 +245,7 @@ ANN static Array_Sub instantiate_typedef(MemPool p, const m_uint depth) { ANN2(1,2) m_bool emit_instantiate_object(const Emitter emit, const Type type, const Array_Sub arr, const m_bool is_ref) { + emit_notpure(emit); if(type->array_depth) { assert(!arr || arr->depth == type->array_depth); const Array_Sub array = arr ?: instantiate_typedef(emit->gwion->mp, type->array_depth); @@ -260,7 +261,6 @@ ANN2(1,2) m_bool emit_instantiate_object(const Emitter emit, const Type type, instr->m_val2 = (m_uint)type; emit_pre_ctor(emit, type); } - emit_notpure(emit); return GW_OK; }