Commit 5d5fcc4
refactor(reader): drop dead
Two follow-ups:
- checkBlobBounds: drop the `length < 0` clause. Every caller passes a
u32-masked PostscriptSegment.length() (`bb.getInt(..) & 0xFFFFFFFFL`), always
>= 0, so the branch is unreachable — the equivalent mutant pitest flagged.
Removing it takes the reader file-structure classes to a 100% mutation score
(the only non-killed mutation is a depth-recursion timeout, which pitest
counts as detected). The `offset < 0` check stays — offset is u64 and can read
back negative.
- Tests: reuse the public PTypeIO.LE_INT / LE_SHORT layout constants instead of
re-declaring them locally, and inline the single-use I32 dtype (no shared
DType constant exists — it is duplicated per test file).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>length < 0 blob check; reuse PTypeIO LE layouts1 parent c9243f9 commit 5d5fcc4
3 files changed
Lines changed: 10 additions & 17 deletions
File tree
- reader/src
- main/java/io/github/dfa1/vortex/reader
- test/java/io/github/dfa1/vortex/reader
Lines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
97 | 99 | | |
98 | 100 | | |
99 | 101 | | |
| |||
Lines changed: 3 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
16 | 14 | | |
17 | 15 | | |
| 16 | + | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
| |||
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | 29 | | |
36 | 30 | | |
37 | 31 | | |
| |||
49 | 43 | | |
50 | 44 | | |
51 | 45 | | |
52 | | - | |
| 46 | + | |
| 47 | + | |
53 | 48 | | |
54 | 49 | | |
55 | 50 | | |
| |||
Lines changed: 1 addition & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | 8 | | |
| 9 | + | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
| |||
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | 20 | | |
25 | 21 | | |
26 | 22 | | |
| |||
0 commit comments