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 4351f4a
Browse filesBrowse the repository at this point in the historyBrowse files
extractor: pooled buffer transferred to a wrapper via an escaping local is not a leak
Oracle sweep (StackExchange.Redis) surfaced a false-positive class: a rented
ArrayPool buffer handed to `new Wrapper(buf)` that is bound to a LOCAL which then
leaves the method — `var lease = new Lease(arr); return lease;` (Lease<T>.Create)
and `var r = new ScanResult(keys); SetResult(m, r);` (RedisServer scan) — was
flagged OWN001 "rented but never returned". The buffer is transferred to the
wrapper (which owns the Return), not leaked.
PassedToEscapingCtor already exempts the DIRECT `return new Wrapper(buf)` /
`_field = new Wrapper(buf)`. The Codex one-level rule deliberately kept a
wrapper-in-a-local as a borrow (a method-scoped wrapper that never returns the
buffer is a real leak). WrapperLocalEscapes adds the one-extra-hop case while
preserving that: the `new Wrapper(buf)` bound to a local `w` is a transfer only
when `w` provably leaves the method (`return w` / `<field> = w` / `w` as a call
argument); a wrapper local that stays method-scoped still leaks.
Corpus fixture pool-transfer-via-wrapper-local: before.cs (wrapper dropped
method-scoped -> OWN001 caught) / after.cs (wrapper returned -> clean). Also
re-runs the Redis oracle (oracle-target bump) to confirm the 4 own-only FPs
clear. corpus 31/31, ruff clean.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019846YSZ35c7CdkWQ1qX5gm
0 commit comments