Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add function to check validity and alignment of LLVM pointers #422

Merged
merged 2 commits into from
Jan 28, 2020

Conversation

brianhuffman
Copy link
Contributor

New function isAllocatedAlignedPointer is used to to check that an LLVM pointer is valid, points to an allocated region of sufficient size and mutability, and that the pointer meets the required minimum alignment.

@@ -1738,9 +1764,18 @@ ppMerge vpp c x y =
where ppAllocList [] = (<+> text "<none>")
ppAllocList xs = (<$$> indent 2 (vcat $ map vpp xs))

ppAlignment :: Alignment -> Doc
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: probably should special case for no particular alignment. Seeing 1-byte-aligned seems like it would b3e pretty confusing, as opposed to no alignment or just nothing at all.

Copy link
Contributor

@langston-barrett langston-barrett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I like the printing changes too! This API should be harder to misuse.

@brianhuffman brianhuffman merged commit 104f34e into master Jan 28, 2020
@travitch travitch deleted the bh-pointer branch December 16, 2021 18:53
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.

None yet

3 participants