mirror of
https://github.com/php/php-src.git
synced 2026-03-24 08:12:21 +01:00
Fix tests: Prevent stack overflow during dtor
On s390x the stack is smaller and/or the object dtor code uses more stack, which causes the destruction of deeply nested objects to crash in these tests. Here I ensure that objects are released one by one at the end of the tests to avoid recursive dtor. Closes GH-16561 Fixes GH-16528
This commit is contained in:
@@ -31,6 +31,10 @@ var_dump(json_encode($firstNode, depth: 500000));
|
||||
var_dump(json_last_error());
|
||||
var_dump(json_last_error_msg());
|
||||
|
||||
while ($next = $firstNode->next) {
|
||||
$firstNode->next = $next->next;
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
|
||||
@@ -30,6 +30,11 @@ try {
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
while ($next = $firstNode->next) {
|
||||
$firstNode->next = $next->next;
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Maximum call stack size reached. Infinite recursion?
|
||||
|
||||
Reference in New Issue
Block a user