Repository navigation
Commit 397395d
committed
fix(extractor): scope projection-escape to
The first cut excluded only poolBuffers (ArrayPool) and usingMemoryOwners (using-declared
MemoryPool), but a `var` MemoryPool.Rent owner is in neither — so its `.Memory` handoff wrongly
untracked it, dropping the dangling-borrow / double-dispose findings (OWN002/OWN003). The
corpus benchmark caught it: memorypool-double-dispose regressed (recall 23 -> 22).
Scope the projection-escape to a new `newedDisposables` whitelist — locals created via `new`
(the WrapMemory `new ByteMemoryManager(...)` shape). A pool rental of ANY kind (ArrayPool or
MemoryPool, `var` or `using`) is never `new`'d, so it keeps its full use-after-dispose tracking;
the renter owns the Return/Dispose. Stricter and more self-evident than enumerating pool sets.
Sample/CI gain a MemoryPool-owner boundary case: `pooled.Dispose(); Store(pooled.Memory)` must
still trip OWN002 (not be silenced). handedOwner stays silent, leakedOwner still warns.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rg8kSk1YT14x7A1vo5zgEDnew'd owners only — keep pool-rental tracking (Codex/CodeRabbit P1)1 parent c7a24f4 commit 397395d
3 files changed
Lines changed: 25 additions & 4 deletions
File tree
- .github/workflows
- frontend/roslyn
- OwnSharp.Extractor
- samples
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
571 | 571 | | |
572 | 572 | | |
573 | 573 | | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
574 | 579 | | |
575 | 580 | | |
576 | 581 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2461 | 2461 | | |
2462 | 2462 | | |
2463 | 2463 | | |
| 2464 | + | |
2464 | 2465 | | |
2465 | 2466 | | |
2466 | 2467 | | |
| |||
2481 | 2482 | | |
2482 | 2483 | | |
2483 | 2484 | | |
| 2485 | + | |
2484 | 2486 | | |
| 2487 | + | |
| 2488 | + | |
2485 | 2489 | | |
2486 | 2490 | | |
2487 | 2491 | | |
| |||
2583 | 2587 | | |
2584 | 2588 | | |
2585 | 2589 | | |
2586 | | - | |
2587 | | - | |
2588 | | - | |
2589 | | - | |
| 2590 | + | |
| 2591 | + | |
| 2592 | + | |
| 2593 | + | |
| 2594 | + | |
| 2595 | + | |
2590 | 2596 | | |
2591 | 2597 | | |
2592 | 2598 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
39 | 49 | | |
0 commit comments