Skip to content

Commit 35647aa

Browse files
committed
Merge branch 'PHP-8.2'
2 parents a44acde + 9a20f43 commit 35647aa

File tree

4 files changed

+27
-1
lines changed

4 files changed

+27
-1
lines changed

Zend/tests/arginfo_zpp_mismatch.inc

Lines changed: 1 addition & 0 deletions
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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,23 @@ static ZEND_FUNCTION(zend_get_map_ptr_last)
533533
RETURN_LONG(CG(map_ptr_last));
534534
}
535535

536+
static ZEND_FUNCTION(zend_test_crash)
537+
{
538+
zend_string *message;
539+
540+
ZEND_PARSE_PARAMETERS_START(0, 1)
541+
Z_PARAM_OPTIONAL
542+
Z_PARAM_STR_OR_NULL(message)
543+
ZEND_PARSE_PARAMETERS_END();
544+
545+
if (message) {
546+
php_printf("%s", ZSTR_VAL(message));
547+
}
548+
549+
char *invalid = (char *) 1;
550+
php_printf("%s", invalid);
551+
}
552+
536553
static ZEND_FUNCTION(zend_test_fill_packed_array)
537554
{
538555
HashTable *parameter;

ext/zend_test/test.stub.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ function zend_test_is_string_marked_as_valid_utf8(string $string): bool {}
193193

194194
function zend_get_map_ptr_last(): int {}
195195

196+
function zend_test_crash(?string $message = null): void {}
197+
196198
function zend_test_fill_packed_array(array &$array): void {}
197199
}
198200

ext/zend_test/test_arginfo.h

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)