Commit f5d3a4c
committed
common: Cast via uintptr_t rather than unsigned long in UNCONST
On ILP32 and LP64 systems, unsigned long is sufficient to round-trip
pointers, but on LLP64 systems it is too small, and on systems like
CHERI where pointers are capabilities, it does not propagate capability
metadata, and casting back to a pointer to yield a pointer that cannot
be dereferenced.
Instead, cast via uintptr_t to ensure we always use an integral type
that can losslessly round-trip pointers.1 parent cd0b269 commit f5d3a4c
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
0 commit comments