Bug #2110
closedBug #1450: Illumos should be buildable with GCC4
liblvm should avoid extending pointers
100%
Description
Yet another bug where someone casts a pointer to a larger sized integer and risks sign extension!
Are we having fun yet?
In a struct mdnm_params, as generally given to metaioctl, we have a devname field that's conceptually a pointer but is actually uint64_t rather than uintptr_t. As such, when 32bit, there's a risk the actual pointer assigned to it will be sign-extended, it needs to be cast to uintptr_t first to make sure that doesn't occur.
I'm not going to get into the rathole of why this is a fixed 64bit type rather than something the size of a native pointer, I can see how we'd get here, and changing it is prohibitively costly in test/time.
Updated by Rich Lowe about 10 years ago
- Status changed from New to Resolved
- % Done changed from 80 to 100
Resolved in r13606 commit:3720d427d9fa