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

fix(prof): PHP 8.4 crash with opcache optimizer #3038

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion profiling/src/profiling/stack_walking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,14 @@ mod detail {
// allowed because it's only used on the frameless path
#[allow(unused_variables)]
if let Some(func) = unsafe { execute_data.func.as_ref() } {
// It's possible that this is a fake frame put there by
// the engine, see accel_preload on PHP 8.4 and the local
// variable `fake_execute_data`. The frame is zeroed in
// this case, so we can check for null.
#[cfg(php_frameless)]
if !func.is_internal() {
if !func.is_internal() && !execute_data.opline.is_null() {
// SAFETY: if it's not null, then it should be valid
// or something else has messed up already.
let opline = unsafe { &*execute_data.opline };
match opline.opcode as u32 {
ZEND_FRAMELESS_ICALL_0
Expand Down
Loading