| Age | Commit message (Collapse) | Author |
|
PHP 8.5's opcache optimizer can inline trivial user functions (constant
return values), completely eliminating the DO_UCALL opcode. When this
happens, zend_execute_ex is never invoked and snuffleupagus's
return-value monitoring hooks never fire.
Fix this by setting ZEND_ACC_HAS_TYPE_HINTS on monitored functions'
op_arrays during compilation (via sp_op_array_handler). This flag is
checked by opcache's zend_try_inline_call() and prevents inlining.
For 0-arg functions — the only ones eligible for inlining — there are
no RECV opcodes, so the runtime impact is zero.
To enable sp_op_array_handler when return-value rules are configured,
the extension now registers itself as a zend extension and sets
ZEND_COMPILE_HANDLE_OP_ARRAY (previously only done for global_strict).
The disabled_function_echo_2 test is updated to use separate echo
statements and opcache.optimization_level=0, since opcache's echo
merging is a compile-time string concatenation that cannot be prevented
per-function.
This is a bit ugly, but it's the less awful solution to be able to hook return
values.
|
|
PHP is now optimizing `echo A,B,C` into `echo A B C`, so the test is pointless.
|
|
On uncommon architectures, like s390x, `-2` instead of `-1` might be printed.
|
|
Co-authored-by: Julien "jvoisin" Voisin <julien.voisin@dustri.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Snuffleupagus will now warn when a particular function
doesn't have the expected parameters configuration-wise.
|
|
PHP8 failed hard when it couldn't find the local variable
we're looking for.
using ZEND_FETCH_CLASS_SILENT makes it silent.
|
|
|
|
|
|
|
|
* Skip tests broken on php8
* Oops
* Fix some tests
* Add some XXE tests for php8
* Fix a test
|
|
This is required since the `die` is making php8 choke
|
|
|
|
Co-authored-by: Giovanni Dante Grazioli <giovanni.dantegrazioli@nbs-system.com>
|
|
|
|
Apparently, php is now raising errors for non-existing
keys in arrays, so we're now catching the exception
to allow the test to be run.
|
|
Before php7.4, it seems that the curl module was loaded by default, but since
it's no the case anymore, it has to be manually specified in the testsuite.
Interestingly, Php's testsuite mechanism is running snippets to determine some
runtime parameters like the extension directory. Unfortunately,it tries to run
them with Snuffleupagus loaded, resulting in an error, since no configuration
file is passed.
|
|
Since I'm the only one to maintain Snuffleupagus,
let's adjust the links and contact addresses
of my fork, to point to well… my fork.
|
|
|
|
In php8, it's non-trivial to hook strlen,
since this function is usually optimized away
by the compiler.
|
|
Splitting the testsuite in several components makes it easier to manage and comprehend.
This was also needed some some tests aren't passing on Alpine Linux, but we still want to run
as many of them as we can on this platform.
|