From 27343af9a72db08d500b119d9411d57d9541d30a Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Tue, 26 May 2020 18:57:36 +0200 Subject: [PATCH] :bug: Fix emit->code stack, class_def must return error on failure --- src/emit/emit.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/emit/emit.c b/src/emit/emit.c index 25eb7002..2c6a0e84 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -2033,8 +2033,10 @@ ANN static m_bool emit_class_def(const Emitter emit, const Class_Def cdef) { emit_class_code(emit, t->name); if(scanx_body(emit->env, cdef, (_exp_func)emit_section, emit) > 0) emit_class_finish(emit, t->nspc); - else + else { emit_pop_code(emit); + return GW_ERROR; + } } return GW_OK; } -- 2.43.0