Skip to content

fix(cfg): resolve continues through stacked loop labels - #29016

Merged
graphite-app[bot] merged 1 commit into
mainfrom
codex/fix-28945-stacked-label-continue
Nov 7, 2026
Merged

graphite-app[bot] merged 1 commit into
mainfrom
codex/fix-28945-stacked-label-continue

Conversation

@camc314

@camc314 camc314 commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Stacked labels on a loop are all valid continue targets. Named continues to outer labels currently lose their CFG jump edges, causing false positives in no-unreachable and no-unreachable-loop:

function count() {
  let n = 0;
  a: b: do { n++; continue a; } while (n < 3);
  return n;
}

Queue named continues in the loop context immediately after their matched label stack, preserving unlabeled continue lookup and distinct labeled break targets. Resolve do…while continue edges before its condition's outgoing edges so the exit inherits the condition's reachable state. Regression tests cover all five loop forms, every position in a three-label stack, nested continues, and do…while exit reachability.

ESLint 10.14.0 currently shares the reported false positives; the issue's examples both return 3 in Node.

Fixes #28945

@camc314
camc314 requested a review from Dunqing as a code owner November 7, 2026 18:41
Copilot AI balanced review requested due to automatic review settings November 7, 2026 18:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-07T19:49:03.748219Z 7ec606f New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added A-linter Area - Linter (oxlint): rules, config, diagnostics, fixes. Add L-* labels for details A-semantic Area - Scopes, symbols, references and semantic errors, oxc_semantic A-cfg Area - Control flow graph, oxc_cfg labels Nov 7, 2026
@codspeed

codspeed Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 97 untouched benchmarks
⏩ 9 skipped benchmarks1


Comparing codex/fix-28945-stacked-label-continue (7ec606f) with main (43c5273)

Open in CodSpeed

Footnotes

  1. 9 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@camc314
camc314 force-pushed the codex/fix-28945-stacked-label-continue branch from a8dae53 to 7ec606f Compare November 7, 2026 19:46
@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Nov 7, 2026

camc314 commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor Author

Merge activity

Stacked labels on a loop are all valid `continue` targets. Named continues to outer labels currently lose their CFG jump edges, causing false positives in `no-unreachable` and `no-unreachable-loop`:

```js
function count() {
  let n = 0;
  a: b: do { n++; continue a; } while (n < 3);
  return n;
}
```

Queue named continues in the loop context immediately after their matched label stack, preserving unlabeled continue lookup and distinct labeled break targets. Resolve `do…while` continue edges before its condition's outgoing edges so the exit inherits the condition's reachable state. Regression tests cover all five loop forms, every position in a three-label stack, nested continues, and `do…while` exit reachability.

ESLint 10.14.0 currently shares the reported false positives; the issue's examples both return `3` in Node.

Fixes #28945
@graphite-app
graphite-app Bot force-pushed the codex/fix-28945-stacked-label-continue branch from 7ec606f to a791a5b Compare November 7, 2026 22:14
@graphite-app
graphite-app Bot merged commit a791a5b into main Nov 7, 2026
33 checks passed
@graphite-app graphite-app Bot removed the 0-merge Merge with Graphite Merge Queue label Nov 7, 2026
@graphite-app
graphite-app Bot deleted the codex/fix-28945-stacked-label-continue branch November 7, 2026 22:17
graphite-app Bot pushed a commit that referenced this pull request Nov 9, 2026
### 🐛 Bug Fixes

- de6ac92 isolated-declarations: Preserve object accessor mutability (#29039) (camc314)
- 3729ce1 transformer/typescript: Merge exported enums across namespace blocks (#28999) (camc314)
- 7243594 minifier: Preserve throwing ArrayBuffer and URI calls (#29012) (camc314)
- 67ac6be isolated-declarations: Evaluate enum template literal initializers (#28997) (camc314)
- f05b30e isolated-declarations: Infer auto-accessor initializer types (#29038) (camc314)
- 030d410 isolated-declarations: Preserve computed ambient enum members (#29040) (camc314)
- 6303df1 jsdoc: Preserve param tags after unmatched description delimiters (#28923) (Vishal Punjabi)
- 99e67d3 transformer: Preserve static private brands with shadowed class names (#28894) (Dunqing)
- 595f3c2 minifier: Preserve left-hand side effects in instanceof checks (#29011) (camc314)
- a791a5b cfg: Resolve continues through stacked loop labels (#29016) (camc314)
- 9e3b3d1 ecmascript: Reject signs after nondecimal prefixes (#29034) (camc314)
- 43c5273 ecmascript: Round nondecimal strings to numbers once (#29026) (camc314)
- b71234f cfg: Skip labeled contexts for unlabeled jumps (#29001) (camc314)
- fd51bff jsdoc: Handle every line terminators as newline (#28902) (leaysgur)
- c00dc61 codegen: Keep one source map mapping per generated position (#28844) (YT)
- 52f3e3d jsdoc: Do not treat `@word` containing `/` as tag (#28834) (leaysgur)
- 0b48483 minifier: Preserve UTF-16 boundaries in empty-search replaceAll folding (#28807) (huuya)
- 1e57a4e codegen: Print infinite numeric literals as `1e400` instead of `Infinity` (#28812) (Dominic Elm)
- 28a44b7 transformer/class-properties: Preserve private accessor assignment receivers (#28790) (Dunqing)
- ea76490 transformer/class-properties: Preserve private method values in assignments (#28788) (Dunqing)
- 8432de6 transformer/class-properties: Apply a compound assignment to a static private field once (#28606) (YT)
- 3dbf140 parser: Treat escaped contextual keywords as names, not modifiers (#28748) (Dominic Elm)
- e3b1bb4 transformer/class-properties: Keep the value of a private accessor assignment (#28716) (YT)
- ae7474e minifier: Keep array concat chain reads before later side effects (#28261) (Dunqing)
- ec327aa semantic: Keep block type bindings separate from hoisted vars (#28601) (YT)
- 3fd78d7 codegen: Preserve names in duplicate source mappings (#26051) (camc314)

### ⚡ Performance

- 7761a39 codegen: Remove redundant sourcemap buffer shrinks (#28893) (Dunqing)
- bee25de regular_expression: Check only the latest group per name in duplicate prescan (#29083) (Yuji Sugiura)
- 4da1752 codegen: Use SWAR scanning and shared column tables (#28939) (Dunqing)
- cc84126 mangler: Inline candidate checks during slot assignment (#28881) (Dunqing)
- 6611cf9 parser: Specialize quoted string value access (#28965) (Boshen)
- 5038ba6 parser: Avoid repeated await-using lookahead (#28960) (Boshen)
- ecc807b parser: Skip discarded arrow diagnostics (#28940) (Boshen)
- c880368 parser: Fast-path absent TypeScript type lists (#28959) (Boshen)
- dee6cf4 parser: Skip repeated optional call lookahead (#28876) (Boshen)
- a524e17 parser: Reuse successful parenthesized arrow heads (#28862) (Boshen)
- 296b12a parser: Accelerate line comment scanning (#28878) (Boshen)
- c4fc21e parser: Accelerate escaped string scanning (#28907) (Boshen)
- f7726b6 parser: Accelerate regex literal scanning (#28911) (Boshen)
- a8aff38 parser: Scan whitespace in runs (#28953) (Boshen)
- b1c137c parser: Avoid lookahead for TypeScript keyword types (#28954) (Boshen)
- 6a8a2a7 parser: Fast-path plain identifiers (#28955) (Boshen)
- 00deb87 parser: Initialize declaration lists with their first item (#28956) (Boshen)
- 71dd877 parser: Specialize binary operator associativity (#28957) (Boshen)
- 732a8e4 codegen: Skip repeated word scans for sourcemap tails (#28869) (Dunqing)
- 6972243 codegen: Accelerate sourcemap line scanning (#28400) (codspeed)
- 027eb7e parser: Combine async arrow lookahead (#28431) (Boshen)
- 7b933d5 lexer: Directly dispatch common punctuation (#28792) (Boshen)
- 45d86c3 lexer: Combine per-token annotation resets (#28492) (Boshen)
- d497fbf lexer: Match keywords with byte patterns (#28494) (Boshen)

### 📚 Documentation

- 844c28c syntax: Correct crate capabilities and module records (#29075) (camc314)
- 8d30d9b traverse: Clarify ancestor access during traversal (#29074) (camc314)
- a74b7cd ecmascript: Clarify test locations (#29072) (camc314)
- 7acaa4e mangler: Correct naming strategy and pipeline order (#29073) (camc314)
- ed28291 ast: Clarify which AST nodes use arena allocation (#29070) (camc314)
- d5832ab oxc: Correct README APIs and feature requirements (#29068) (camc314)
- 261c4a2 allocator: Clarify arena storage and memory reclamation (#29066) (camc314)
- 6448a54 napi/parser: Correct parser options and usage guidance (#29065) (camc314)
- 157fc5a napi/minify: Correct minifier capabilities and caveats (#29064) (camc314)
- 6989796 parser: Update TS-ESTree import differences (#29061) (camc314)
graphite-app Bot pushed a commit that referenced this pull request Nov 9, 2026
# Oxlint
### 🚀 Features

- 6195265 linter/promise/prefer-catch: Implement suggestion (#28919) (Mikhail Baev)

### 🐛 Bug Fixes

- 9c62d2a linter/eslint/no-unreachable-loop: Ignore enclosing finalizers for continues (#29004) (camc314)
- 6303df1 jsdoc: Preserve param tags after unmatched description delimiters (#28923) (Vishal Punjabi)
- fe66fa7 linter/eslint/no-lone-blocks: Report redundant blocks in function bodies (#29043) (camc314)
- e1694bd linter/unicorn/no-useless-undefined: Preserve shadowed bindings (#29046) (camc314)
- 791b5f5 linter/unicorn/prefer-regexp-test: Restrict automatic argument swaps (#29045) (camc314)
- e7654f6 linter/react/display-name: Ignore unrelated memo and forwardRef calls (#29005) (camc314)
- 2487360 linter/unicorn/no-useless-undefined: Report guarded indexed access (#29014) (camc314)
- a791a5b cfg: Resolve continues through stacked loop labels (#29016) (camc314)
- 287ba19 linter/eslint/id-length: Ignore TypeScript qualified references (#29037) (camc314)
- b71234f cfg: Skip labeled contexts for unlabeled jumps (#29001) (camc314)
- bb21a3c linter/import/no-anonymous-default-export: Report parenthesized exports (#29002) (camc314)
- f38f738 linter/eslint/prefer-destructuring: Skip fixes that remove comments (#29003) (camc314)
- bf11006 linter/react/exhaustive-deps: Suggest dependency removals (#28925) (camc314)
- 6bbb92a linter: Remove unused `oxlint-disable` directives with `--fix` (#27698) (Ryan Tsao)
- 3b35cb6 linter/disable-directives: Preserve separators and disable spans (#28921) (camc314)
- 1253445 linter/eslint/no-restricted-imports: Report re-exported imports once (#28920) (Ramy Akin Saidi)

### ⚡ Performance

- da620e6 linter: Start tsgolint before the regular lint pass (#28824) (Max Schwenk)
# Oxfmt
### 🐛 Bug Fixes

- 449e91f oxfmt: Format ts-in-astro as TSX (#29080) (leaysgur)
- 8d8845e formatter/jsdoc: Strip `*` prefixes from multiline default value (#28910) (leaysgur)
- cdb1501 formatter/jsdoc: Handle every line terminator in multi-line JSDoc types (#28909) (leaysgur)
- fd51bff jsdoc: Handle every line terminators as newline (#28902) (leaysgur)
- 2f80765 formatter_toml: Format whitespace-only document to empty (#28899) (leaysgur)
- 5e1e02c formatter_graphql: Allow empty document (#28898) (leaysgur)
- 06e72c0 formatter/tailwind: Normalize CR in Tailwind template with `preserveWhitespace` (#28896) (leaysgur)

### ⚡ Performance

- 934ca98 formatter: Use `Arc` for tailwind options across embedding (#29079) (leaysgur)
- dde9c5c formatter_htmlish: Skip `</script` escape if possible (#29078) (leaysgur)
- dc4d918 formatter: Format embedded expr of one name without parsing (#29077) (leaysgur)

### 📚 Documentation

- eb2eb2d formatter_htmlish: Cover block elements in `DIVERGENCES.md#interpolation-element-as-text` (#28901) (leaysgur)
- 0f4ec80 formatter/tailwind: Note Tailwind sorting tears escaped whitespace apart (#28900) (leaysgur)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cfg Area - Control flow graph, oxc_cfg A-linter Area - Linter (oxlint): rules, config, diagnostics, fixes. Add L-* labels for details A-semantic Area - Scopes, symbols, references and semantic errors, oxc_semantic

Projects

None yet

Development

Successfully merging this pull request may close these issues.

linter: no-unreachable false positives when continue targets an outer stacked label

2 participants