From df41a4512932f1312e4725d0409757a683b091ed Mon Sep 17 00:00:00 2001 From: lemon Date: Sat, 20 Aug 2022 06:35:05 +0200 Subject: defer fix --- bootstrap/parse.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'bootstrap/parse.c') diff --git a/bootstrap/parse.c b/bootstrap/parse.c index 4b56c2b..371289f 100644 --- a/bootstrap/parse.c +++ b/bootstrap/parse.c @@ -2569,6 +2569,7 @@ parsestmt(stmt_yielder_t yield, void *yarg, struct parser *P) { assert(block != NULL && "defer outside block"); defer->age = deferage++; defer->ex = ex; + defer->blockid = P->curblock->id; defer->next = block->defers; block->defers = defer; st.t = Sblock; @@ -2617,10 +2618,12 @@ parseblock0(struct parser *P) { vec_t(struct stmt) stmts = {0}; struct blockstmt block = {0}; int tokt; + static int id; block.env.parent = P->curenv; pushenv(P, &block.env); block.defers = P->curblock ? P->curblock->defers : NULL; + block.id = id++; WITH_TMPCHANGE(struct blockstmt *, P->curblock, &block) { while ((tokt = lexpeek(P).t) != '}' && tokt != TKkw_case && tokt != ')') { if (lexmatch(P, NULL, ';')) -- cgit v1.2.3