src: introduce ptr_get_address()
This commit is contained in:
@@ -498,8 +498,16 @@ void upx_compiler_sanity_check(void) noexcept {
|
||||
CheckIntegral<ptrdiff_t>::check();
|
||||
CheckIntegral<size_t>::check();
|
||||
CheckIntegral<upx_off_t>::check();
|
||||
CheckIntegral<upx_ptraddr_t>::check();
|
||||
CheckIntegral<upx_uintptr_t>::check();
|
||||
|
||||
COMPILE_TIME_ASSERT(ptrdiff_t(0) - 1 < 0);
|
||||
COMPILE_TIME_ASSERT(intptr_t(0) - 1 < 0);
|
||||
COMPILE_TIME_ASSERT(size_t(0) - 1 > 0);
|
||||
COMPILE_TIME_ASSERT(uintptr_t(0) - 1 > 0);
|
||||
COMPILE_TIME_ASSERT(upx_ptraddr_t(0) - 1 > 0);
|
||||
COMPILE_TIME_ASSERT(upx_uintptr_t(0) - 1 > 0);
|
||||
|
||||
COMPILE_TIME_ASSERT(sizeof(upx_charptr_unit_type) == 1)
|
||||
COMPILE_TIME_ASSERT_ALIGNED1(upx_charptr_unit_type)
|
||||
COMPILE_TIME_ASSERT(sizeof(*((charptr) nullptr)) == 1)
|
||||
|
||||
@@ -54,6 +54,7 @@ ACC_COMPILE_TIME_ASSERT_HEADER((!upx::is_same_any_v<int, char, long>) )
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER((upx::is_same_any_v<ptrdiff_t, int, long, long long>) )
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER(
|
||||
(upx::is_same_any_v<size_t, unsigned, unsigned long, unsigned long long>) )
|
||||
// TODO later: CHERI
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER(
|
||||
(upx::is_same_any_v<upx_uintptr_t, unsigned, unsigned long, unsigned long long>) )
|
||||
|
||||
|
||||
Reference in New Issue
Block a user