Commit e0165b4
Range
`processArrayType` fed only the explicit `getValueTypes()` into the
min/max comparison, so `min(array{1, 2, ...<int, int>})` inferred `1`
and `max(...)` inferred `2` — unsound, since the unsealed extras can
be any int above or below the explicit entries.
Append the unsealed value type to the comparison arguments when the
constant array `isUnsealed()->yes()`, so the result widens to cover
the extras (`int` here). Sealed constant arrays keep their exact
min/max.
`vsprintf` was on the same verify list but is already sound: it reads
only the positions the format references (extras beyond them are
ignored) and bails to a general string when a referenced position
falls outside the explicit keys.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>min() / max() over unsealed extras of a constant array1 parent 9bbf9b8 commit e0165b4
2 files changed
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
131 | 139 | | |
132 | 140 | | |
133 | 141 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
21 | 33 | | |
22 | 34 | | |
23 | 35 | | |
| |||
0 commit comments