Skip to content
Closed
Show file tree
Hide file tree
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
19 changes: 19 additions & 0 deletions Zend/tests/property_hooks/gh19548.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
--TEST--
GH-19548: Segfault when using inherited properties and opcache
--FILE--
<?php

interface I {
public mixed $i { get; }
}
class P {
public mixed $i;
}

class C extends P implements I {}

echo "Test passed - no segmentation fault\n";

?>
--EXPECT--
Test passed - no segmentation fault
29 changes: 29 additions & 0 deletions Zend/tests/property_hooks/gh19548_002.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
--TEST--
GH-19548: Segfault when using inherited properties and opcache (multiple properties)
--FILE--
<?php

interface I1 {
public mixed $a { get; }
public mixed $b { get; }
}
class P1 {
public mixed $a;
public mixed $b;
}
class C1 extends P1 implements I1 {}

interface I2 {
public mixed $prop { get; }
}
class P2 {
public mixed $prop;
}
class Q2 extends P2 {}
class C2 extends Q2 implements I2 {}

echo "Multiple property test passed - no segmentation fault\n";

?>
--EXPECT--
Multiple property test passed - no segmentation fault
4 changes: 3 additions & 1 deletion Zend/zend_inheritance.c
Original file line number Diff line number Diff line change
Expand Up @@ -1564,7 +1564,9 @@ static void do_inherit_property(zend_property_info *parent_info, zend_string *ke
ZSTR_VAL(parent_info->ce->name));
}

child_info->flags &= ~ZEND_ACC_OVERRIDE;
if (child_info->ce == ce) {
child_info->flags &= ~ZEND_ACC_OVERRIDE;
}
}
} else {
zend_function **hooks = parent_info->hooks;
Expand Down