From: Brendan Hansen Date: Sat, 29 Jan 2022 14:02:02 +0000 (-0600) Subject: fixed the quick fix X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=c64e99af71048570203640e4355cfc5920aff931;p=onyx.git fixed the quick fix --- diff --git a/src/symres.c b/src/symres.c index c4f40bfa..9a1b8eb1 100644 --- a/src/symres.c +++ b/src/symres.c @@ -653,7 +653,15 @@ static SymresStatus symres_switch(AstSwitch* switchnode) { SYMRES(expression, &switchnode->expr); - SYMRES(block, switchnode->case_block); + if (switchnode->cases == NULL) { + SYMRES(block, switchnode->case_block); + } else { + bh_arr_each(AstSwitchCase *, pcase, switchnode->cases) { + SYMRES(case, *pcase); + } + + if (switchnode->default_case) SYMRES(block, switchnode->default_case); + } if (switchnode->switch_kind == Switch_Kind_Use_Equals && switchnode->case_exprs) { bh_arr_each(CaseToBlock, ctb, switchnode->case_exprs) { @@ -889,9 +897,9 @@ static SymresStatus symres_block(AstBlock* block) { if (block->body) { AstNode** start = &block->body; - // fori (i, 0, block->statement_idx) { - // start = &(*start)->next; - // } + fori (i, 0, block->statement_idx) { + start = &(*start)->next; + } b32 remove = 0;