Skip to content

Commit 9a20f43

Browse files
committed
Merge branch 'PHP-8.1' into PHP-8.2
2 parents 1799327 + 0ac55e9 commit 9a20f43

File tree

4 files changed

+27
-1
lines changed

4 files changed

+27
-1
lines changed

Zend/tests/arginfo_zpp_mismatch.inc

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ function skipFunction($function): bool {
99
/* intentionally violate invariants */
1010
|| $function === 'zend_create_unterminated_string'
1111
|| $function === 'zend_test_array_return'
12+
|| $function === 'zend_test_crash'
1213
|| $function === 'zend_leak_bytes'
1314
/* mess with output */
1415
|| (is_string($function) && str_starts_with($function, 'ob_'))

ext/zend_test/test.c

+17
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,23 @@ static ZEND_FUNCTION(zend_get_map_ptr_last)
463463
RETURN_LONG(CG(map_ptr_last));
464464
}
465465

466+
static ZEND_FUNCTION(zend_test_crash)
467+
{
468+
zend_string *message;
469+
470+
ZEND_PARSE_PARAMETERS_START(0, 1)
471+
Z_PARAM_OPTIONAL
472+
Z_PARAM_STR_OR_NULL(message)
473+
ZEND_PARSE_PARAMETERS_END();
474+
475+
if (message) {
476+
php_printf("%s", ZSTR_VAL(message));
477+
}
478+
479+
char *invalid = (char *) 1;
480+
php_printf("%s", invalid);
481+
}
482+
466483
static zend_object *zend_test_class_new(zend_class_entry *class_type)
467484
{
468485
zend_object *obj = zend_objects_new(class_type);

ext/zend_test/test.stub.php

+2
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ function zend_test_zend_ini_parse_uquantity(string $str): int {}
168168
function zend_test_zend_ini_str(): string {}
169169

170170
function zend_get_map_ptr_last(): int {}
171+
172+
function zend_test_crash(?string $message = null): void {}
171173
}
172174

173175
namespace ZendTestNS {

ext/zend_test/test_arginfo.h

+7-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)