From a5e37dcb8a594f7998cdbb30a99929ce7a23cc56 Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Wed, 13 Nov 2024 17:38:34 +0000 Subject: [PATCH] Fix Clang -Wshadow-uncaptured-local warning. --- src/codegen/pass2_generate.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/codegen/pass2_generate.cc b/src/codegen/pass2_generate.cc index 591daed21..aaeff2af3 100644 --- a/src/codegen/pass2_generate.cc +++ b/src/codegen/pass2_generate.cc @@ -674,9 +674,6 @@ static CodeList* gen_goifl( OutAllocator& alc = output.allocator; const opt_t* opts = output.block().opts; - CodeList* stmts = code_list(alc); - const CodeGoBranch* b = go->branches, *e = b + go->nbranches; - auto transition = [&](const CodeGoBranch* b) { if (b->kind == CodeGoBranch::Kind::JUMP) { CodeList* code = code_list(alc); @@ -687,6 +684,9 @@ static CodeList* gen_goifl( } }; + CodeList* stmts = code_list(alc); + const CodeGoBranch* b = go->branches, *e = b + go->nbranches; + if (opts->code_model != CodeModel::REC_FUNC) { // In goto/label and loop/switch modes generate a sequence of IF statements. // It is possible to use IF/ELSE-IF.../ELSE instead, but this would prevent folding YYSKIP