-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Allow testing pointers for inboundedness while forbidding dangling pointers #56985
Conversation
} | ||
InboundsCheck::MaybeDead => self.get_size_and_align(ptr.alloc_id), | ||
}; | ||
ptr.check_in_alloc(allocation_size, liveness)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is check_in_alloc
still used anywhere else? Might be worth to inline it here, because it clearly has a confusing API.
src/librustc_mir/interpret/memory.rs
Outdated
ptr.check_in_alloc(allocation_size, InboundsCheck::MaybeDead)?; | ||
let (allocation_size, align) = match liveness { | ||
InboundsCheck::Live => { | ||
let alloc = self.get(ptr.alloc_id)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this error on function pointers?
cfddd36
to
c8bcac5
Compare
Still not a fan of @bors r+ |
📌 Commit c8bcac5 has been approved by |
Can you formulate your unhappiness with |
Allow testing pointers for inboundedness while forbidding dangling pointers r? @RalfJung
Rollup of 10 pull requests Successful merges: - #55470 (box: Add documentation for `From` impls) - #56242 (Add missing link in docs) - #56944 (bootstrap: Link LLVM as a dylib with ThinLTO) - #56978 (Add `std::os::fortanix_sgx` module) - #56985 (Allow testing pointers for inboundedness while forbidding dangling pointers) - #56986 (rustc: Move jemalloc from rustc_driver to rustc) - #57010 (Actually run compiletest tests on CI) - #57021 (Enable emission of alignment attrs for pointer params) - #57074 (Fix recursion limits) - #57085 (librustc_codegen_llvm: Don't eliminate empty structs in C ABI on linux-sparc64) Failed merges: r? @ghost
r? @RalfJung