Skip to content

Commit

Permalink
Fix bug #5182 (#5184)
Browse files Browse the repository at this point in the history
* Fix bug #5182

* Fix bug #5182

* reset pointer

* add 8.3 test
  • Loading branch information
NathanFreeman authored Nov 10, 2023
1 parent 0e6fec6 commit 348a5ff
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/test-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['8.0', '8.1', '8.2']
php: ['8.0', '8.1', '8.2', '8.3']
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php }}"
coverage: none
- name: Show machine information
run: |
date
Expand Down
17 changes: 17 additions & 0 deletions ext-src/php_swoole.cc
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,24 @@ PHP_RINIT_FUNCTION(swoole) {
&& !(CG(compiler_options) & ZEND_COMPILE_PRELOAD)
#endif
) {
// https://github.com/swoole/swoole-src/issues/5182
/**
* xdebug will hook zend_execute_ex to xdebug_execute_ex.
* This would cause php_swoole_load_library function not to execute correctly, so it must be replaced
* with the execute_ex function.
*/
void (*old_zend_execute_ex)(zend_execute_data *execute_data) = nullptr;
if (UNEXPECTED(zend_execute_ex != execute_ex)) {
old_zend_execute_ex = zend_execute_ex;
zend_execute_ex = execute_ex;
}

php_swoole_load_library();

if (UNEXPECTED(old_zend_execute_ex)) {
zend_execute_ex = old_zend_execute_ex;
old_zend_execute_ex = nullptr;
}
}

#ifdef ZEND_SIGNALS
Expand Down

0 comments on commit 348a5ff

Please sign in to comment.