Repository navigation
Commit 78c041a
fix(roslyn): a region opened inside the protocol's own types is refused, not skipped
The types that declare a protocol are trusted: their bodies implement it and
are not lowered. The lowering skipped every method of such a type — including
one that USES the protocol. A handler written in the same class as the region
entry it calls was therefore never analysed, and read as clean:
public static class ParcelHandlers
{
[ProtocolRegion] public static void WithPacked(...) => ...;
public static void Dispatch(Parcel parcel)
{
WithPacked(parcel, packed => { packed.Send(); packed.Send(); });
}
}
Before: exit 0, no function emitted, verdict clean — a token spent twice.
After: exit 2. Trusted is not the same as checked, and an unanalysed region
must not read as a clean one. The remedy is in the message: use the protocol
from outside the types that declare it.
Found while probing what an unrelated attribute that merely shares the name
[ProtocolRegion] does to a scan. refused/R15 pins it; no committed fact moves
(18 cases, 15 refused, 0 failures), and the extractor's output on every C#
sample CI scans is still equal to main's, 122 of 122.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>1 parent ab678eb commit 78c041a
4 files changed
Lines changed: 57 additions & 1 deletion
File tree
- frontend/roslyn
- OwnSharp.Extractor
- protocol-samples/refused
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
121 | 131 | | |
122 | 132 | | |
123 | 133 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
138 | 142 | | |
139 | 143 | | |
140 | 144 | | |
| |||
| 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 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
0 commit comments