mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Enable HT RC assertions with escape-hatch
HT functions that modify the array now assert that rc=1. As we don't respect this COW constraint everywhere, either for a good reason or because fixing it would take more work, we provide an escape hatch in the form of HT_ALLOW_COW_VIOLATION(ht). If this macro is called assertions on this ht are disabled. The macro is a no-op in release mode.
This commit is contained in:
parent
5c6bf3598a
commit
fd4025069d
6 changed files with 77 additions and 47 deletions
|
@ -795,6 +795,11 @@ static zend_bool php_auto_globals_create_server(zend_string *name)
|
|||
zend_hash_update(&EG(symbol_table), name, &PG(http_globals)[TRACK_VARS_SERVER]);
|
||||
Z_ADDREF(PG(http_globals)[TRACK_VARS_SERVER]);
|
||||
|
||||
/* TODO: TRACK_VARS_SERVER is modified in a number of places (e.g. phar) past this point,
|
||||
* where rc>1 due to the $_SERVER global. Ideally this shouldn't happen, but for now we
|
||||
* ignore this issue, as it would probably require larger changes. */
|
||||
HT_ALLOW_COW_VIOLATION(Z_ARRVAL(PG(http_globals)[TRACK_VARS_SERVER]));
|
||||
|
||||
return 0; /* don't rearm */
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue