summaryrefslogtreecommitdiffstats
path: root/5537.patch
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2024-10-22 12:08:25 +0200
committerRemi Collet <remi@php.net>2024-10-22 12:08:25 +0200
commit87a0f33effbe7d8e29dfcced9059d556ba65e242 (patch)
tree1bd76f873398171221b5326e5eb0d5fa66d5743d /5537.patch
parentf8a9cb44e4bc1e3d765693f542c56bdb8f61f46e (diff)
add fix for PHP 8.4 from
https://github.com/swoole/swoole-src/pull/5537
Diffstat (limited to '5537.patch')
-rw-r--r--5537.patch90
1 files changed, 90 insertions, 0 deletions
diff --git a/5537.patch b/5537.patch
new file mode 100644
index 0000000..c787d4d
--- /dev/null
+++ b/5537.patch
@@ -0,0 +1,90 @@
+From f2a69dbb6817e29d85aa9a8e8e4aa4a4498aedf8 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Tue, 22 Oct 2024 09:35:27 +0200
+Subject: [PATCH 1/3] Fix #5536 remove unneeded include of php_pdo_int.h
+
+---
+ thirdparty/php84/pdo_pgsql/pgsql_sql_parser.c | 1 -
+ thirdparty/php84/pdo_sqlite/sqlite_sql_parser.c | 1 -
+ 2 files changed, 2 deletions(-)
+
+diff --git a/thirdparty/php84/pdo_pgsql/pgsql_sql_parser.c b/thirdparty/php84/pdo_pgsql/pgsql_sql_parser.c
+index c030abc318b..d74ff5a7a8f 100644
+--- a/thirdparty/php84/pdo_pgsql/pgsql_sql_parser.c
++++ b/thirdparty/php84/pdo_pgsql/pgsql_sql_parser.c
+@@ -21,7 +21,6 @@
+
+ #include "php.h"
+ #include "ext/pdo/php_pdo_driver.h"
+-#include "ext/pdo/php_pdo_int.h"
+ #include "ext/pdo/pdo_sql_parser.h"
+
+ int pdo_pgsql_scanner(pdo_scanner_t *s)
+diff --git a/thirdparty/php84/pdo_sqlite/sqlite_sql_parser.c b/thirdparty/php84/pdo_sqlite/sqlite_sql_parser.c
+index 05e702fbd53..442ccb1aff6 100644
+--- a/thirdparty/php84/pdo_sqlite/sqlite_sql_parser.c
++++ b/thirdparty/php84/pdo_sqlite/sqlite_sql_parser.c
+@@ -21,7 +21,6 @@
+
+ #include "php.h"
+ #include "ext/pdo/php_pdo_driver.h"
+-#include "ext/pdo/php_pdo_int.h"
+ #include "ext/pdo/pdo_sql_parser.h"
+
+ int pdo_sqlite_scanner(pdo_scanner_t *s)
+
+From beed9c31075a27d016a0d262e6d89f002d7dade3 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Tue, 22 Oct 2024 10:45:16 +0200
+Subject: [PATCH 3/3] call exit using original function handler
+
+---
+ ext-src/swoole_coroutine.cc | 4 ++--
+ ext-src/swoole_runtime.cc | 12 ++++++++++++
+ 2 files changed, 14 insertions(+), 2 deletions(-)
+
+diff --git a/ext-src/swoole_coroutine.cc b/ext-src/swoole_coroutine.cc
+index eb7c13abb4e..fc3f456a176 100644
+--- a/ext-src/swoole_coroutine.cc
++++ b/ext-src/swoole_coroutine.cc
+@@ -225,7 +225,7 @@ static int coro_exit_handler(zend_execute_data *execute_data) {
+ }
+ #else
+ SW_EXTERN_C_BEGIN
+-extern ZEND_FUNCTION(exit);
++bool swoole_call_original_handler(const char *name, INTERNAL_FUNCTION_PARAMETERS);
+ PHP_FUNCTION(swoole_exit) {
+ zend_long flags = 0;
+ if (Coroutine::get_current()) {
+@@ -251,7 +251,7 @@ PHP_FUNCTION(swoole_exit) {
+ zend_update_property_long(swoole_exit_exception_ce, SW_Z8_OBJ_P(&ex), ZEND_STRL("flags"), flags);
+ zend_update_property_long(swoole_exit_exception_ce, SW_Z8_OBJ_P(&ex), ZEND_STRL("status"), status);
+ } else {
+- ZEND_FN(exit)(INTERNAL_FUNCTION_PARAM_PASSTHRU);
++ swoole_call_original_handler("exit", INTERNAL_FUNCTION_PARAM_PASSTHRU);
+ }
+ }
+ SW_EXTERN_C_END
+diff --git a/ext-src/swoole_runtime.cc b/ext-src/swoole_runtime.cc
+index 13827f9788e..6fbfafdc31f 100644
+--- a/ext-src/swoole_runtime.cc
++++ b/ext-src/swoole_runtime.cc
+@@ -1170,6 +1170,18 @@ static bool enable_func(const char *name, size_t l_name) {
+ return true;
+ }
+
++SW_EXTERN_C_BEGIN
++bool swoole_call_original_handler(const char *name, INTERNAL_FUNCTION_PARAMETERS) {
++ real_func *rf = (real_func *) zend_hash_str_find_ptr(tmp_function_table, name, strlen(name));
++ if (!rf) {
++ return false;
++ }
++ rf->ori_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU);
++
++ return true;
++}
++SW_EXTERN_C_END
++
+ void PHPCoroutine::disable_unsafe_function() {
+ for (auto &f : unsafe_functions) {
+ disable_func(f.c_str(), f.length());