Skip to content

Commit 50dad0c

Browse files
committed
Manually drop zval
1 parent 709ad4b commit 50dad0c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/exception.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,9 @@ pub fn throw_with_code(ex: &ClassEntry, code: i32, message: &str) -> Result<()>
206206
/// throw_object( error.into_zval(true).unwrap() );
207207
/// ```
208208
pub fn throw_object(zval: Zval) -> Result<()> {
209+
let mut zv = core::mem::ManuallyDrop::new(zval);
209210
unsafe {
210-
zend_throw_exception_object((&zval as *const _) as *mut _);
211+
zend_throw_exception_object(core::ptr::addr_of_mut!(zv).cast())
211212
};
212213
Ok(())
213214
}

0 commit comments

Comments
 (0)