Commit 64145d2
Fix static-size FFI type aliases
Several type aliases with statically sized names (e.g. `npy_uint64`)
were being aliased to platform-dependent types like
`::std::os::raw::c_long`. Most of these were barely used, so it seems
like they didn't cause problems before, but now with `npy_uint64` being
used in certain structs, which are the target of pointer punning, the
mismatch in sizes became visible. For example, `npy_uint64` was
previously typedef'd to `c_ulong`, which is 64 bits on 64-bit platforms
and on all Unix-likes, but 32 bits on Windows 32-bit. This caused
inaccurate reads through pointers to structs containing them, eventually
resulting in attempts to derefence null pointers.1 parent 9095a77 commit 64145d2
1 file changed
+8
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
0 commit comments