Skip to content

Commit

Permalink
Update profiling/src/exception.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Levi Morrison <levi.morrison@datadoghq.com>
  • Loading branch information
realFlowControl and morrisonlevi committed Jan 8, 2024
1 parent 00122ca commit ecc4a5d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions profiling/src/exception.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,14 @@ impl ExceptionProfilingStats {
#[cfg(php8)]
let exception_name = unsafe { (*exception).class_name() };

#[cfg(php7)]
let message = unsafe {
zend::zai_str_from_zstr(zend::zai_exception_message((*exception).value.obj).as_mut())
#[cfg(php7)]
let exception_obj = (*exception).value.obj;
#[cfg(php8)]
let exception_obj = exception;
zend::zai_str_from_zstr(zend::zai_exception_message(exception_obj).as_mut())
.into_string()
};
#[cfg(php8)]
let message = unsafe {
zend::zai_str_from_zstr(zend::zai_exception_message(exception).as_mut()).into_string()
};

self.next_sampling_interval();

Expand Down

0 comments on commit ecc4a5d

Please sign in to comment.