From: fennecdjay Date: Wed, 9 Oct 2019 22:51:27 +0000 (+0200) Subject: :shirt: Some clean X-Git-Tag: nightly~2198^2~38 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=b3984dc6f4f6865d01b4f0192899bbd5a8f0602a;p=gwion.git :shirt: Some clean --- diff --git a/include/match.h b/include/match.h index dbdb6a2f..9ab0bee2 100644 --- a/include/match.h +++ b/include/match.h @@ -8,10 +8,12 @@ struct Match_ { ANN static inline void match_map(struct Match_ * const match, Exp e) { const Map map = &match->map; map_init(map); + Exp next; do { + next = e->next; e->next = NULL; map_set(map, (vtype)e, 0); - } while((e = e->next)); + } while((e = next)); } ANN static inline void match_unmap(struct Match_ * const match) { diff --git a/src/emit/emit.c b/src/emit/emit.c index cfaf1524..334d670d 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -1341,7 +1341,7 @@ ANN static m_bool emit_stmt_jump(const Emitter emit, const Stmt_Jump stmt) { if(!stmt->is_label) stmt->data.instr = emit_add_instr(emit, Goto); else { - assert(!stmt->data.v.ptr); + assert(stmt->data.v.ptr); const m_uint size = vector_size(&stmt->data.v); if(!size) ERR_B(stmt_self(stmt)->pos, _("label '%s' defined but not used."), s_name(stmt->name)) diff --git a/tests/error/variadic_end_no_start.gw b/tests/error/variadic_end_no_start.gw index 89aed11f..7dc0c9d2 100644 --- a/tests/error/variadic_end_no_start.gw +++ b/tests/error/variadic_end_no_start.gw @@ -1,4 +1,4 @@ -#! [contains] vararg.start not used before vararg.end. this is an error +#! [contains] vararg.start not used before vararg.end fun void test(int i, ...) { vararg.end; #! vararg.start; diff --git a/tests/error/variadic_start_twice.gw b/tests/error/variadic_start_twice.gw index 59e93491..dd192f7a 100644 --- a/tests/error/variadic_start_twice.gw +++ b/tests/error/variadic_start_twice.gw @@ -1,2 +1,2 @@ -#! [contains] vararg.start already used. this is an error +#! [contains] vararg.start already used fun void test(...) { vararg.start; vararg.start;} diff --git a/tests/error/variadic_test.gw b/tests/error/variadic_test.gw index 89aed11f..7dc0c9d2 100644 --- a/tests/error/variadic_test.gw +++ b/tests/error/variadic_test.gw @@ -1,4 +1,4 @@ -#! [contains] vararg.start not used before vararg.end. this is an error +#! [contains] vararg.start not used before vararg.end fun void test(int i, ...) { vararg.end; #! vararg.start;