Repository navigation
Commit 5291fa9
committed
feat(extractor): emit fresh-returning factory facts for D5.2 (real-C# interprocedural leaks)
Wire the Roslyn extractor (--flow-locals) to produce the OwnIR the D5.2
fresh-return machinery consumes, so first-party factory leaks are caught on real
C# (not just synthetic unit tests):
- A new'd IDisposable returned BARE outside a try stays tracked and lowers to
acquire + return <var>, so the core classifies the method returnsOwned: fresh
(the return discharges it -> the factory itself stays silent). A return inside a
try, or a using/pool/owning-factory local, keeps its existing behaviour.
- var r = FirstPartyFactory() (a source-visible method returning an owned
IDisposable) emits a new call callee=... result=r op. The core mints the acquire
only when it proves the callee fresh, so a non-fresh first-party call is never
falsely owned. IsFirstPartyDisposableFactory gates on source-declared, non-void,
disposable, non-dispose-optional return; overloads resolve to unknown (silent).
Adds FactoryLeakSample.cs + a CI assertion: a dropped factory result leaks
interprocedurally (OWN001 at the call site), the disposed caller and the factory
stay silent. Bridge side already proven by the D5.2 unit tests; this closes the
extractor gap so the capability fires on real code.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fmwk5ruExKy5fQ77CJ2NtF1 parent 1b82c24 commit 5291fa9
4 files changed
Lines changed: 118 additions & 7 deletions
File tree
- .github/workflows
- docs/notes
- frontend/roslyn
- OwnSharp.Extractor
- samples
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
642 | 642 | | |
643 | 643 | | |
644 | 644 | | |
645 | | - | |
| 645 | + | |
| 646 | + | |
646 | 647 | | |
647 | 648 | | |
648 | 649 | | |
| |||
821 | 822 | | |
822 | 823 | | |
823 | 824 | | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
824 | 835 | | |
825 | 836 | | |
826 | 837 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
297 | | - | |
298 | | - | |
299 | | - | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
300 | 310 | | |
301 | 311 | | |
302 | 312 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
560 | 560 | | |
561 | 561 | | |
562 | 562 | | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
563 | 585 | | |
564 | 586 | | |
565 | 587 | | |
| |||
758 | 780 | | |
759 | 781 | | |
760 | 782 | | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
761 | 790 | | |
762 | 791 | | |
763 | 792 | | |
| |||
849 | 878 | | |
850 | 879 | | |
851 | 880 | | |
852 | | - | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
853 | 891 | | |
854 | 892 | | |
855 | 893 | | |
| |||
3181 | 3219 | | |
3182 | 3220 | | |
3183 | 3221 | | |
| 3222 | + | |
| 3223 | + | |
| 3224 | + | |
| 3225 | + | |
| 3226 | + | |
| 3227 | + | |
3184 | 3228 | | |
3185 | 3229 | | |
3186 | 3230 | | |
| |||
3254 | 3298 | | |
3255 | 3299 | | |
3256 | 3300 | | |
3257 | | - | |
| 3301 | + | |
3258 | 3302 | | |
3259 | | - | |
| 3303 | + | |
| 3304 | + | |
| 3305 | + | |
| 3306 | + | |
| 3307 | + | |
| 3308 | + | |
| 3309 | + | |
| 3310 | + | |
| 3311 | + | |
| 3312 | + | |
| 3313 | + | |
| 3314 | + | |
3260 | 3315 | | |
3261 | 3316 | | |
3262 | 3317 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
0 commit comments