You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9230647
Browse filesBrowse the repository at this point in the historyBrowse files
fix(pool): also catch the using (...) STATEMENT form of the MemoryPool view escape (CodeRabbit)
#74's using-desugar only matched the `using` DECLARATION form (LocalDeclarationStatementSyntax with
UsingKeyword). The equivalent `using (IMemoryOwner owner = MemoryPool.Rent(n)) { return owner.Memory; }`
STATEMENT form has the same scope-exit dispose, so the returned view dangles the same way — but
UsingStatementSyntax only lowered its body and the candidate pass only scanned
LocalDeclarationStatementSyntax, so the statement-form owner was untracked and silent.
Extend both: the candidate pass now scans UsingStatementSyntax declarations for IsMemoryPoolRent, and
the UsingStatementSyntax flow case desugars a tracked MemoryPool owner into
`acquire; try { body } finally { release }` exactly like the declaration form. Corpus:
memorypool-using-statement-view-escape (-> OWN002; after.cs returns the owner -> silent). Benchmark
recall floor 18 -> 19.
Not in scope (distinct follow-up, Codex review): `using owner; return owner;` — returning the OWNER
itself (not a view) stays silent because the escape pass untracks directly-returned owners as
ownership transfers; catching it needs the escape pass to treat a using-owner's direct return as a
dangling rather than a transfer.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rg8kSk1YT14x7A1vo5zgED
0 commit comments