Skip to content

Commit 6bd13e4

Browse files
Fix symbol not found (#5690)
1 parent b85c2e2 commit 6bd13e4

File tree

4 files changed

+22
-2
lines changed

4 files changed

+22
-2
lines changed

.github/workflows/ext.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v4
1414
- name: install-deps
15-
run: sudo apt update -y && sudo apt install -y libcurl4-openssl-dev php-curl libc-ares-dev
15+
run: sudo apt update -y && sudo apt install -y libcurl4-openssl-dev php-curl libc-ares-dev libbrotli-dev
1616
- name: phpize
1717
run: phpize
1818
- name: build1

ext-src/swoole_runtime.cc

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,22 @@ static zend_internal_arg_info *copy_arginfo(zend_function *zf, zend_internal_arg
196196
return new_arg_info + 1;
197197
}
198198

199+
static void free_arg_info(zend_internal_function *function) {
200+
if ((function->fn_flags & (ZEND_ACC_HAS_RETURN_TYPE | ZEND_ACC_HAS_TYPE_HINTS)) && function->arg_info) {
201+
uint32_t i;
202+
uint32_t num_args = function->num_args + 1;
203+
zend_internal_arg_info *arg_info = function->arg_info - 1;
204+
205+
if (function->fn_flags & ZEND_ACC_VARIADIC) {
206+
num_args++;
207+
}
208+
for (i = 0; i < num_args; i++) {
209+
zend_type_release(arg_info[i].type, /* persistent */ 1);
210+
}
211+
free(arg_info);
212+
}
213+
}
214+
199215
#define SW_HOOK_FUNC(f) hook_func(ZEND_STRL(#f), PHP_FN(swoole_##f))
200216
#define SW_UNHOOK_FUNC(f) unhook_func(ZEND_STRL(#f))
201217
#define SW_HOOK_WITH_NATIVE_FUNC(f) \
@@ -2025,7 +2041,7 @@ static void unhook_func(const char *name, size_t l_name) {
20252041
return;
20262042
}
20272043
if (rf->arg_info_copy) {
2028-
zend_free_internal_arg_info(&rf->function->internal_function);
2044+
free_arg_info(&rf->function->internal_function);
20292045
rf->arg_info_copy = nullptr;
20302046
}
20312047
rf->function->internal_function.handler = rf->ori_handler;

include/swoole_coroutine.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
#include <functional>
3333
#include <string>
3434
#include <unordered_map>
35+
#ifdef SW_USE_THREAD_CONTEXT
36+
#include <system_error>
37+
#endif
3538

3639
typedef std::chrono::microseconds seconds_type;
3740

src/os/async_thread.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include <mutex>
3232
#include <queue>
3333
#include <sstream>
34+
#include <system_error>
3435

3536
namespace swoole {
3637
namespace async {

0 commit comments

Comments
 (0)