From b6eab5b6870e6facfc06b7e0063d81a60491eec4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Tue, 1 Sep 2020 20:40:30 +0200 Subject: [PATCH] :bug: Some (func) types do not have tuples --- src/emit/emit.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/emit/emit.c b/src/emit/emit.c index e7660b04..1169192a 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -78,6 +78,8 @@ ANN static inline void frame_push(Frame* frame) { } ANN static void struct_pop(const Emitter emit, const Type type, const m_uint offset) { + if(!type->e->tuple) + return; for(m_uint i = 0; i < vector_size(&type->e->tuple->types); ++i) { const Type t = (Type)vector_at(&type->e->tuple->types, i); if(isa(t, emit->gwion->type[et_object]) > 0) { @@ -1320,6 +1322,8 @@ DECL_EXP_FUNC(emit, m_bool, Emitter) ANN static void struct_addref(const Emitter emit, const Type type, const m_int size, const m_bool offset, const m_bool emit_var) { + if(!type->e->tuple) + return; for(m_uint i = 0; i < vector_size(&type->e->tuple->types); ++i) { const Type t = (Type)vector_at(&type->e->tuple->types, i); if(isa(t, emit->gwion->type[et_object]) > 0) { -- 2.43.0