Migrate to strict and exposed provenance

This commit is contained in:
bakaq
2025-04-26 23:34:53 -03:00
committed by Mark Thom
parent cb9b988905
commit a9847eef65
11 changed files with 69 additions and 73 deletions

View File

@@ -517,7 +517,7 @@ impl Value {
fn as_ptr(&mut self) -> Result<*mut c_void, FFIError> {
match self {
Value::CString(ref mut cstr) => Ok(&mut *cstr as *mut _ as *mut c_void),
Value::Int(n) => Ok(*n as *mut c_void),
Value::Int(n) => Ok(std::ptr::with_exposed_provenance_mut(*n as usize)),
_ => Err(FFIError::ValueCast),
}
}