Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
14 changes: 14 additions & 0 deletions ext/opcache/jit/zend_jit_ir.c
Original file line number Diff line number Diff line change
Expand Up @@ -3237,6 +3237,20 @@ static void zend_jit_setup(void)
/* Index is offset by 1 on FreeBSD (https://github.com/freebsd/freebsd-src/blob/22ca6db50f4e6bd75a141f57cf953d8de6531a06/lib/libc/gen/tls.c#L88) */
tsrm_tls_index = (tlsdesc->index + 1) * 8;
}
# elif defined(__MUSL__)
if (tsrm_ls_cache_tcb_offset == 0) {
size_t **where;

__asm__(
"adrp %0, :tlsdesc:_tsrm_ls_cache\n"
"add %0, %0, :tlsdesc_lo12:_tsrm_ls_cache\n"
: "=r" (where));
/* See https://github.com/ARM-software/abi-aa/blob/2a70c42d62e9c3eb5887fa50b71257f20daca6f9/aaelf64/aaelf64.rst */
size_t *tlsdesc = where[1];

tsrm_tls_offset = tlsdesc[1];
tsrm_tls_index = tlsdesc[0] * 8;
}
# else
ZEND_ASSERT(tsrm_ls_cache_tcb_offset != 0);
# endif
Expand Down
2 changes: 1 addition & 1 deletion ext/pdo_pgsql/pgsql_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ static bool pgsql_handle_preparer(pdo_dbh_t *dbh, zend_string *sql, pdo_stmt_t *
execute_only = 1;
}
} else {
emulate = H->disable_native_prepares || H->emulate_prepares;
emulate = H->emulate_prepares;
execute_only = H->disable_prepares;
}

Expand Down
3 changes: 0 additions & 3 deletions ext/pdo_pgsql/php_pdo_pgsql_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@ typedef struct {
pdo_pgsql_error_info einfo;
Oid pgoid;
unsigned int stmt_counter;
/* The following two variables have the same purpose. Unfortunately we need
to keep track of two different attributes having the same effect. */
bool emulate_prepares;
bool disable_native_prepares; /* deprecated since 5.6 */
bool disable_prepares;
HashTable *lob_streams;
zend_fcall_info_cache *notice_callback;
Expand Down
4 changes: 2 additions & 2 deletions ext/standard/tests/streams/bug51056.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Bug #51056 (fread() on blocking stream will block even if data is available)
<?php

$serverCode = <<<'CODE'
$server = stream_socket_server('tcp://127.0.0.1:64324');
$server = stream_socket_server('tcp://127.0.0.1:64327');
phpt_notify();

$conn = stream_socket_accept($server);
Expand All @@ -23,7 +23,7 @@ $clientCode = <<<'CODE'

phpt_wait();

$fp = fsockopen("tcp://127.0.0.1:64324");
$fp = fsockopen("tcp://127.0.0.1:64327");

while (!feof($fp)) {
$data = fread($fp, 256);
Expand Down
7 changes: 5 additions & 2 deletions ext/zend_test/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -1108,9 +1108,12 @@ static ZEND_METHOD(_ZendTestMagicCallForward, __call)

ZEND_IGNORE_VALUE(arguments);

zval func;
zval func, rv;
ZVAL_STR(&func, name);
call_user_function(NULL, NULL, &func, return_value, 0, NULL);
call_user_function(NULL, NULL, &func, &rv, 0, NULL);

ZVAL_COPY_DEREF(return_value, &rv);
zval_ptr_dtor(&rv);
}

PHP_INI_BEGIN()
Expand Down
18 changes: 18 additions & 0 deletions ext/zend_test/tests/gh16908.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--TEST--
GH-16908 (_ZendTestMagicCallForward does not handle references well)
--EXTENSIONS--
zend_test
--FILE--
<?php
$cls = new _ZendTestMagicCallForward();
function &foo() {
}
$cls->foo()->x ??= 42;
?>
--EXPECTF--
Notice: Only variable references should be returned by reference in %s on line %d

Fatal error: Uncaught Error: Attempt to assign property "x" on null in %s:%d
Stack trace:
#0 {main}
thrown in %s on line %d
3 changes: 2 additions & 1 deletion main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2120,8 +2120,9 @@ zend_result php_module_startup(sapi_module_struct *sf, zend_module_entry *additi
_set_invalid_parameter_handler(old_invalid_parameter_handler);
}

/* Disable the message box for assertions.*/
/* Disable the message box for assertions and errors.*/
_CrtSetReportMode(_CRT_ASSERT, 0);
_CrtSetReportMode(_CRT_ERROR, 0);
#endif

#ifdef ZTS
Expand Down
2 changes: 1 addition & 1 deletion run-tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
/* Let there be no top-level code beyond this point:
* Only functions and classes, thanks!
*
* Minimum required PHP version: 7.4.0
* Minimum required PHP version: 8.0.0
*/

function show_usage(): void
Expand Down