Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
24 changes: 24 additions & 0 deletions Zend/tests/gh18833.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
--TEST--
GH-18833 (Use after free with weakmaps dependent on destruction order)
--FILE--
<?php

class a {
public static WeakMap $map;
public static Generator $storage;
}

a::$map = new WeakMap;

$closure = function () {
$obj = new a;
a::$map[$obj] = true;
yield $obj;
};
a::$storage = $closure();
a::$storage->current();

echo "ok\n";
?>
--EXPECT--
ok
4 changes: 3 additions & 1 deletion Zend/zend_objects_API.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ ZEND_API void ZEND_FASTCALL zend_objects_store_free_object_storage(zend_objects_
if (IS_OBJ_VALID(obj)) {
if (!(OBJ_FLAGS(obj) & IS_OBJ_FREE_CALLED)) {
GC_ADD_FLAGS(obj, IS_OBJ_FREE_CALLED);
if (obj->handlers->free_obj != zend_object_std_dtor) {
if (obj->handlers->free_obj != zend_object_std_dtor
|| (OBJ_FLAGS(obj) & IS_OBJ_WEAKLY_REFERENCED)
) {
GC_ADDREF(obj);
obj->handlers->free_obj(obj);
}
Expand Down
2 changes: 1 addition & 1 deletion ext/iconv/tests/translit-failure.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Translit failure
iconv
--SKIPIF--
<?php
( ICONV_IMPL != "libiconv" ) and die("skip ICONV_IMPL != \"libiconv\"");
( ICONV_IMPL != "libiconv" && ICONV_IMPL != "\"libiconv\"" ) and die("skip ICONV_IMPL != \"libiconv\"");
?>
--INI--
error_reporting=2039
Expand Down
2 changes: 1 addition & 1 deletion ext/iconv/tests/translit-utf8.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Translit UTF-8 quotes
iconv
--SKIPIF--
<?php
( ICONV_IMPL != "libiconv" ) and die("skip ICONV_IMPL != \"libiconv\"");
( ICONV_IMPL != "libiconv" && ICONV_IMPL != "\"libiconv\"" ) and die("skip ICONV_IMPL != \"libiconv\"");
?>
--INI--
error_reporting=2047
Expand Down
2 changes: 1 addition & 1 deletion ext/pdo_sqlite/pdo_sqlite.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Sqlite extends \PDO
/** @cvalue PDO_SQLITE_ATTR_EXPLAIN_STATEMENT */
public const int ATTR_EXPLAIN_STATEMENT = UNKNOWN;

#if SQLITE_VERSION_NUMBER >= 3041000
#if SQLITE_VERSION_NUMBER >= 3043000
public const int EXPLAIN_MODE_PREPARED = 0;
public const int EXPLAIN_MODE_EXPLAIN = 1;
public const int EXPLAIN_MODE_EXPLAIN_QUERY_PLAN = 2;
Expand Down
8 changes: 4 additions & 4 deletions ext/pdo_sqlite/pdo_sqlite_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions ext/pdo_sqlite/sqlite_statement.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ static int pdo_sqlite_stmt_get_attribute(pdo_stmt_t *stmt, zend_long attr, zval
}
break;
case PDO_SQLITE_ATTR_EXPLAIN_STATEMENT:
#if SQLITE_VERSION_NUMBER >= 3041000
#if SQLITE_VERSION_NUMBER >= 3043000
#if defined(__APPLE__)
if (__builtin_available(macOS 14.2, *)) {
#endif
Expand All @@ -420,7 +420,7 @@ static int pdo_sqlite_stmt_set_attribute(pdo_stmt_t *stmt, zend_long attr, zval
{
switch (attr) {
case PDO_SQLITE_ATTR_EXPLAIN_STATEMENT:
#if SQLITE_VERSION_NUMBER >= 3041000
#if SQLITE_VERSION_NUMBER >= 3043000
#if defined(__APPLE__)
if (__builtin_available(macOS 14.2, *)) {
#endif
Expand Down
Loading