Repository navigation
Commit 35d2eed
committed
extractor: a bare-LOCAL assignment rent is not a field rent (syntactic POOL001 pass)
Second Redis pooled-buffer FP: RedisServer scan does `RedisKey[] keys; … keys =
ArrayPool<RedisKey>.Shared.Rent(count); … new ScanResult(cursor, keys, count,
true)`. The buffer is transferred to ScanResult, which owns the Return (its
Recycle() -> ArrayPool.Return, called by CursorEnumerable on ProcessReply/
Dispose) — confirmed in source. So OWN001 "rented but never returned" was a false
positive.
Root cause: the syntactic POOL001 pass classifies an assignment-target rent via
FieldName(asg.Left), which is purely syntactic (returns the identifier text for
ANY target). A bare local (`keys = Rent()`, keys pre-declared) was thus treated
as a field-backed rent with isField=true and NO escape/transfer analysis. The
pass is meant for real fields (rented in ctor, Returned class-wide in Dispose);
gate the assignment arm on `model.GetSymbolInfo(asg.Left).Symbol is IFieldSymbol`
so a bare-local assignment rent is not flagged here. Such a local belongs to the
flow pass, which does escape analysis but does not track the assignment form —
so it is honestly untracked rather than flagged unsoundly (precision-first; the
rare bare-assign-then-dropped local leak is a recall gap, not a false positive).
No sample regression (all sample assignment rents are `this.field = Rent()`
fields or `var`/`T[] x = Rent()` declarations). Re-runs the Redis oracle to
confirm RedisServer.cs:917 clears. corpus 31/31.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019846YSZ35c7CdkWQ1qX5gm1 parent 4351f4a commit 35d2eed
2 files changed
Lines changed: 21 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4024 | 4024 | | |
4025 | 4025 | | |
4026 | 4026 | | |
4027 | | - | |
4028 | | - | |
4029 | | - | |
| 4027 | + | |
| 4028 | + | |
| 4029 | + | |
| 4030 | + | |
| 4031 | + | |
| 4032 | + | |
| 4033 | + | |
| 4034 | + | |
| 4035 | + | |
| 4036 | + | |
| 4037 | + | |
| 4038 | + | |
| 4039 | + | |
| 4040 | + | |
| 4041 | + | |
| 4042 | + | |
4030 | 4043 | | |
4031 | 4044 | | |
4032 | 4045 | | |
| |||
0 commit comments