Draft
Conversation
Like __call trampolines, we can use an opcode-based trampoline to reduce recursion/reentering, and reuse the call frame of the trampoline. Also: Rebase fixes, update tests, add tests.
Girgias
reviewed
Jun 29, 2025
Comment on lines
+208
to
+209
| /* Internal functions use an incompatible arg_info struct | ||
| * TODO: unify zend_arg_info / zend_internal_arg_info? */ |
There was a problem hiding this comment.
This would be nice to do, but that would require allocating zend_strings rather than using C strings which are inside the binary. Would make a lot of other stuff simpler tho.
Girgias
reviewed
Jun 29, 2025
Zend/zend_types.h
Outdated
Comment on lines
669
to
671
|
It looks like we still need a test for partially applying an invokable object that isn't a Closure. |
TimWolla
reviewed
Jul 2, 2025
| $f = f(?, ?); | ||
|
|
||
| $f(1, 2); | ||
|
|
There was a problem hiding this comment.
Please add a closing PHP tag in every test.
Owner
Author
There was a problem hiding this comment.
We should have a linter for this kind of things :)
8 tasks
arnaud-lb
pushed a commit
that referenced
this pull request
Aug 6, 2025
```
ext/gd/libgd/gd.c:2275:14: runtime error: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'
#0 0x5d6a2103e1db in php_gd_gdImageCopy /home/dcarlier/Contribs/php-src/ext/gd/libgd/gd.c:2275
#1 0x5d6a210a2b63 in gdImageCrop /home/dcarlier/Contribs/php-src/ext/gd/libgd/gd_crop.c:57
#2 0x5d6a21018ca4 in zif_imagecrop /home/dcarlier/Contribs/php-src/ext/gd/gd.c:3575
#3 0x5d6a21e46e7a in ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER /home/dcarlier/Contribs/php-src/Zend/zend_vm_execute.h:1337
#4 0x5d6a221188da in execute_ex /home/dcarlier/Contribs/php-src/Zend/zend_vm_execute.h:57246
#5 0x5d6a221366bd in zend_execute /home/dcarlier/Contribs/php-src/Zend/zend_vm_execute.h:61634
#6 0x5d6a21d107a6 in zend_execute_scripts /home/dcarlier/Contribs/php-src/Zend/zend.c:1895
#7 0x5d6a21a63409 in php_execute_script /home/dcarlier/Contribs/php-src/main/main.c:2529
#8 0x5d6a22516d5e in do_cli /home/dcarlier/Contribs/php-src/sapi/cli/php_cli.c:966
#9 0x5d6a2251981d in main /home/dcarlier/Contribs/php-src/sapi/cli/php_cli.c:1341
#10 0x7f10d002a3b7 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
#11 0x7f10d002a47a in __libc_start_main_impl ../csu/libc-start.c:360
#12 0x5d6a20a06da4 in _start (/home/dcarlier/Contribs/php-src/sapi/cli/php+0x2806da4) (BuildId: d9a79c7e0e4872311439d7313cb3a81fe04190a2)
```
close phpGH-18006
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on php#6898.
With the following changes:
trampolineis now a user function. This avoids re-entering the VM, and allows to re-use the trampoline stack frame when calling the real function. This is similar to__calltrampolines.trampolineandprototypeare merged into a singlezend_function. This simplifies a few things and speeds up PFA creation a bit.ZEND_ACC_andZEND_CALL_flags since there are no free slots anymorenewis not allowedStill a WIP. There are a few things to check and cleanup.
TODO: