1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Merge branch 'PHP-8.3'

* PHP-8.3:
  Fix build with sqlite3 gc and fci/fcc api
This commit is contained in:
Niels Dossche
2023-09-09 16:07:17 +02:00
2 changed files with 19 additions and 4 deletions

View File

@@ -2245,6 +2245,18 @@ static void php_sqlite3_object_free_storage(zend_object *object) /* {{{ */
}
/* }}} */
static void php_sqlite3_gc_buffer_add_fcc(zend_get_gc_buffer *gc_buffer, zend_fcall_info_cache *fcc)
{
if (ZEND_FCC_INITIALIZED(*fcc)) {
if (fcc->object) {
zend_get_gc_buffer_add_obj(gc_buffer, fcc->object);
}
if (fcc->closure) {
zend_get_gc_buffer_add_obj(gc_buffer, fcc->closure);
}
}
}
static HashTable *php_sqlite3_get_gc(zend_object *object, zval **table, int *n)
{
php_sqlite3_db_object *intern = php_sqlite3_db_from_obj(object);
@@ -2259,15 +2271,15 @@ static HashTable *php_sqlite3_get_gc(zend_object *object, zval **table, int *n)
php_sqlite3_func *func = intern->funcs;
while (func != NULL) {
zend_get_gc_buffer_add_zval(gc_buffer, &func->func);
zend_get_gc_buffer_add_zval(gc_buffer, &func->step);
zend_get_gc_buffer_add_zval(gc_buffer, &func->fini);
php_sqlite3_gc_buffer_add_fcc(gc_buffer, &func->func);
php_sqlite3_gc_buffer_add_fcc(gc_buffer, &func->step);
php_sqlite3_gc_buffer_add_fcc(gc_buffer, &func->fini);
func = func->next;
}
php_sqlite3_collation *collation = intern->collations;
while (collation != NULL) {
zend_get_gc_buffer_add_zval(gc_buffer, &collation->cmp_func);
php_sqlite3_gc_buffer_add_fcc(gc_buffer, &collation->cmp_func);
collation = collation->next;
}

View File

@@ -10,10 +10,13 @@ class Foo {
$this->sqlite = new SQLite3(":memory:");
if ($aggregates) {
$this->sqlite->createAggregate("indexes", array($this, "SQLiteIndex"), array($this, "SQLiteFinal"), 0);
$this->sqlite->createAggregate("indexes_closure", fn () => 0, fn () => 0, 0);
}
if ($normalFunctions) {
$this->sqlite->createFunction("func", array($this, "SQLiteIndex"), 0);
$this->sqlite->createFunction("func_closure", fn () => 0, 0);
$this->sqlite->createCollation("collation", array($this, "SQLiteIndex"));
$this->sqlite->createCollation("collation_closure", fn () => 0);
}
}
public function SQLiteIndex() {}