diff options
| author | 2022-08-20 06:35:05 +0200 | |
|---|---|---|
| committer | 2022-08-20 06:47:17 +0200 | |
| commit | df41a4512932f1312e4725d0409757a683b091ed (patch) | |
| tree | 5a87b358529fb2fe92eefa6d4f47e0ac78b4d131 /bootstrap/parse.c | |
| parent | 19acdd751963e88b6e75693f947b1b1fd2912f11 (diff) | |
defer fix
Diffstat (limited to 'bootstrap/parse.c')
| -rw-r--r-- | bootstrap/parse.c | 3 |
1 files changed, 3 insertions, 0 deletions
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, ';')) |