skeeto / skeeto/skeeto.github.com
bug in fat pointer bit hack
Open
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 86
- Forks
- 15
- PR merge metrics
- No merged PRs in 30d
Description
via: https://nullprogram.com/blog/2019/06/30/
// NOTE: x86-64 only!
unsigned char buf[1000];
uintptr addr = (uintptr_t)buf & 0xffffffffffff;
uintptr pack = (sizeof(buf) << 48) | p;
void *fatptr = (void *)pack;
What is p in the above? Also, maybe UINTPTR_MAX is nicer than the constant?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked nullprogram article and the C snippet quoted in this issue. Identify what p should refer to and verify whether UINTPTR_MAX is an appropriate replacement for the hexadecimal mask; the issue is done when the published snippet is corrected and remains valid for its stated x86-64 scope.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100