Skip to content

Conversation

@kkent030315
Copy link
Contributor

@kkent030315 kkent030315 commented Nov 25, 2021

UtilIsInBounds is weirdly used in UtilpIsCanonicalFormAddress which is referenced at UtilIsAccessibleAddress will resulted in UtilIsAccessibleAddress always FALSE.

_Use_decl_annotations_ static bool UtilpIsCanonicalFormAddress(void *address) {
if (!IsX64()) {
return true;
} else {
return !UtilIsInBounds(0x0000800000000000ull, 0xffff7fffffffffffull,
reinterpret_cast<ULONG64>(address));
}
}

was evaluated as:

(0xffff7fffffffffffull <= 0x0000800000000000ull)
&&
(0x0000800000000000ull <= address);

Let me know if anything wrong with my interpret of the canonical address. :)
(I thought it was intentional use?)

@tandasat tandasat merged commit 85eaacb into tandasat:master Nov 25, 2021
@tandasat
Copy link
Owner

Nice catch, and thanks for the PR. Merged it.

@kkent030315 kkent030315 deleted the fix_UtilpIsCanonicalFormAddress branch November 26, 2021 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants