Skip to content

Commit

Permalink
Use standard error message for stack limit in serialize()
Browse files Browse the repository at this point in the history
With GH-16204 merged, we can use the standard error message for the
recently-merged GH-16159.

Closes GH-16225.
  • Loading branch information
nielsdos committed Oct 4, 2024
1 parent 139acce commit 612a6ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ext/standard/tests/serialize/gh15169.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ try {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
Maximum call stack size reached. Infinite recursion?
--EXPECTF--
Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
2 changes: 1 addition & 1 deletion ext/standard/var.c
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,7 @@ static void php_var_serialize_intern(smart_str *buf, zval *struc, php_serialize_
}

if (UNEXPECTED(php_serialize_check_stack_limit())) {
zend_throw_error(NULL, "Maximum call stack size reached. Infinite recursion?");
zend_call_stack_size_error();
return;
}

Expand Down

0 comments on commit 612a6ad

Please sign in to comment.