Skip to content

Commit 93f5f8a

Browse files
Update profiling/src/exception.rs
Co-authored-by: Levi Morrison <[email protected]>
1 parent 263b8ba commit 93f5f8a

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

profiling/src/exception.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,14 @@ impl ExceptionProfilingStats {
6060
#[cfg(php8)]
6161
let exception_name = unsafe { (*exception).class_name() };
6262

63-
#[cfg(php7)]
6463
let message = unsafe {
65-
zend::zai_str_from_zstr(zend::zai_exception_message((*exception).value.obj).as_mut())
64+
#[cfg(php7)]
65+
let exception_obj = (*exception).value.obj;
66+
#[cfg(php8)]
67+
let exception_obj = exception;
68+
zend::zai_str_from_zstr(zend::zai_exception_message(exception_obj).as_mut())
6669
.into_string()
6770
};
68-
#[cfg(php8)]
69-
let message = unsafe {
70-
zend::zai_str_from_zstr(zend::zai_exception_message(exception).as_mut()).into_string()
71-
};
7271

7372
self.next_sampling_interval();
7473

0 commit comments

Comments
 (0)