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

ALTREP needs to handle null pointers #221

Open
yutannihilation opened this issue Apr 29, 2024 · 0 comments
Open

ALTREP needs to handle null pointers #221

yutannihilation opened this issue Apr 29, 2024 · 0 comments

Comments

@yutannihilation
Copy link
Owner

Probably, this cannot throw error because it all things needs to be handled within Rust and we cannot cross the FFI boundary.

savvy/src/altrep/mod.rs

Lines 83 to 87 in 0f0bbc0

pub(crate) fn extract_self_from_altrep<T>(x: &SEXP) -> &mut T {
let x = unsafe { crate::get_external_pointer_addr(R_altrep_data1(*x)).unwrap() as *mut T };
let self_ = unsafe { x.as_mut() };
self_.expect("Failed to convert the external pointer to the Rust object")
}

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

No branches or pull requests

1 participant