Commit 40233ea
authored
The fuzzer_crash regression test built its polygon by reinterpreting a raw
byte buffer as LatLng doubles (verts = (LatLng *)data), so the decoded
vertices -- and the resulting cell count -- depended on the host's
floating-point byte order. On big-endian architectures the same bytes
decode to different doubles (the first vertex's latitude is even NaN), so
maxPolygonToCellsSizeExperimental returns sz=3 instead of 1 and the
sz == 1 assertion fails.
Specify the vertices as explicit hex-float literals (the exact values the
original bytes decoded to) so the test uses identical input on every
architecture. This keeps the sz == 1 check meaningful and reproduces the
original fuzzer scenario everywhere.
Verified on a native big-endian POWER8 (ppc64) host: the test passes, and
it continues to pass on little-endian.
1 parent e88769b commit 40233ea
2 files changed
Lines changed: 12 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
Lines changed: 10 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
37 | 41 | | |
38 | 42 | | |
39 | 43 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
46 | | - | |
47 | | - | |
48 | | - | |
| 47 | + | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
0 commit comments