[php-src] PR #21922: Vm interrupt tailcall repro
| From: | morrisonlevi | Date: | Thu, 30 Apr 2026 21:09:09 +0000 |
| Subject: | [php-src] PR #21922: Vm interrupt tailcall repro | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-35968@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/21922
Author: morrisonlevi
In the new tailcall VM, if a call like
ZEND_VM_DISPATCH_TO_HELPER(...) uses a helper
like zend_is_smaller_helper_SPEC_TAILCALL(), and during that helper
EG(vm_interrupt) gets set, then it will return the current opline tagged with
ZEND_VM_ENTER_BIT. But the ZEND_VM_DISPATCH_TO_HELPER macro directly
dereferenced the tagged pointer.
This PR changes the macro to check for a tagged pointer, and returns instead of doing the tailcall
as the outer executor will handle the ZEND_VM_ENTER_BIT.
To reproduce this, I piggy-backed on the vm_interrupt machinery in zend_test I just added in #21910.
It uses a compare handler on class VmInterruptComparable to deterministically set the
EG(vm_interrupt).