Skip to content

Commit 89d87cc

Browse files
Fix bug #5347 (#5359)
* fix bug #5347 * skip ci * optimize * remove useless files --------- Co-authored-by: MARiA so cute <[email protected]>
1 parent 8b80b4f commit 89d87cc

File tree

4 files changed

+9
-652
lines changed

4 files changed

+9
-652
lines changed

config.m4

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,8 +1027,7 @@ EOF
10271027
thirdparty/php/sockets/conversions.cc \
10281028
thirdparty/php/sockets/sockaddr_conv.cc \
10291029
thirdparty/php/standard/var_decoder.cc \
1030-
thirdparty/php/standard/proc_open.cc \
1031-
thirdparty/php83/Zend/zend_call_stack.cc"
1030+
thirdparty/php/standard/proc_open.cc"
10321031

10331032
swoole_source_file="$swoole_source_file \
10341033
thirdparty/swoole_http_parser.c \

ext-src/php_swoole_call_stack.h

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,13 @@
1919
#include "php_swoole.h"
2020

2121
#ifdef ZEND_CHECK_STACK_LIMIT
22-
#include "thirdparty/php83/Zend/zend_call_stack.h"
23-
#endif
24-
25-
#ifdef ZEND_CHECK_STACK_LIMIT
26-
#define HOOK_PHP_CALL_STACK(exp) \
27-
zend_call_stack __stack; \
28-
zend_call_stack_get(&__stack); \
29-
auto __stack_base = EG(stack_base); \
30-
auto __stack_limit = EG(stack_limit); \
31-
EG(stack_base) = __stack.base; \
32-
EG(stack_limit) = zend_call_stack_limit(__stack.base, __stack.max_size, EG(reserved_stack_size)); \
33-
exp \
34-
EG(stack_base) = __stack_base; \
35-
EG(stack_limit) = __stack_limit;
22+
#define HOOK_PHP_CALL_STACK(callback) \
23+
auto __stack_limit = EG(stack_limit); \
24+
auto __stack_base = EG(stack_base); \
25+
EG(stack_base) = (void *) 0; \
26+
EG(stack_limit) = (void *) 0; \
27+
callback EG(stack_limit) = __stack_limit; \
28+
EG(stack_base) = __stack_base;
3629
#else
37-
#define HOOK_PHP_CALL_STACK(exp) exp
30+
#define HOOK_PHP_CALL_STACK(callback) callback
3831
#endif

0 commit comments

Comments
 (0)