This fixes the implementation for architectures like CHERI with strong
pointer provenance (pointers, and thus uintptr_t, are represented as
hardware capabilities). On all currently-supported architectures this
should be an NFC, as size_t and uintptr_t end up being the same
underlying plain integer type.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
| compiler-rt/lib/builtins/gcc_personality_v0.c | ||
|---|---|---|
| 215 | Maybe rename this to landingPadOffset to indicate that it's not a pointer? | |
Comments added to hopefully explain it.
| compiler-rt/lib/builtins/gcc_personality_v0.c | ||
|---|---|---|
| 46–48 | This isn't strictly necessary but is more accurate, since this function just creates a machine word sized integer, not a pointer. | |
| 215 | We could, it's just slightly more churn. | |
| 219 | This start + length adds two uintptr_ts together, which does not make sense unless at least one is an integer rather than a pointer. | |
| 227 | This funcStart + landingPad also adds two uintptr_ts together. | |
Thanks!
| compiler-rt/lib/builtins/gcc_personality_v0.c | ||
|---|---|---|
| 217 | If I wrote it in the first place, I'd place landingPad == 0 below the range check, but it has no difference in practice, because __attribute__((cleanup)) has a landing pad. | |
This isn't strictly necessary but is more accurate, since this function just creates a machine word sized integer, not a pointer.