From f793a54248e75a529e0780f2a99dd6ff82119674 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Tue, 15 Oct 2019 23:25:03 +0200 Subject: [PATCH] :gun: Mark function unpure as soon as you emit object --- src/emit/emit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.43.0