harec

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit eebcc41e4044ab817fe35c7ab9a1e87cd5a3c8de
parent 3b0f89da407fabb8a2e08edb8c2c1a1e648b50a2
Author: Drew DeVault <sir@cmpwn.com>
Date:   Tue, 10 Aug 2021 09:51:00 +0200

gen: tolerate missing defer scope in gen_defers

This fixes the funcs test

Signed-off-by: Drew DeVault <sir@cmpwn.com>

Diffstat:
Msrc/gen.c | 4+++-
Mtests/configure | 2+-
2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/gen.c b/src/gen.c @@ -28,7 +28,9 @@ static struct gen_value gen_expr_with(struct gen_context *ctx, static void gen_defers(struct gen_context *ctx) { - assert(ctx->scope); + if (!ctx->scope) { + return; + } if (ctx->scope->defers) { pushc(ctx->current, "gen defers"); } diff --git a/tests/configure b/tests/configure @@ -47,6 +47,7 @@ EOF 05-implicit-casts \ 06-structs \ 07-aliases \ + 09-funcs \ 10-binarithms \ 14-switch \ 17-alloc \ @@ -58,7 +59,6 @@ EOF # Disabled tests #08-slices \ - #09-funcs \ #11-globals \ #12-loops \ #13-tagged \