Skip to content

Commit 33b452c

Browse files
committed
add test for zend_vm_kind and fix unwinder
1 parent e4d812c commit 33b452c

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

.github/workflows/test-suite.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -989,6 +989,8 @@ jobs:
989989
uses: ./.github/actions/setup-windows
990990
- name: Build
991991
run: .github/scripts/windows/build.bat
992+
- name: Verify ZEND_VM_KIND == ZEND_VM_KIND_TAILCALL
993+
run: C:\obj\Release_TS\php.exe -r "if (ZEND_VM_KIND !== 'ZEND_VM_KIND_TAILCALL') { echo 'Expected ZEND_VM_KIND_TAILCALL, got ' . ZEND_VM_KIND . PHP_EOL; exit(1); }"
992994
- name: Test
993995
run: .github/scripts/windows/test.bat
994996
FREEBSD:

ext/opcache/jit/zend_jit_ir.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3315,6 +3315,12 @@ static PRUNTIME_FUNCTION zend_jit_unwind_callback(DWORD64 pc, PVOID context)
33153315

33163316
static void zend_jit_setup_unwinder(void)
33173317
{
3318+
#if ZEND_VM_KIND == ZEND_VM_KIND_TAILCALL
3319+
/* TAILCALL VM uses __preserve_none which changes the JIT prologue structure
3320+
* (R12/R13 are pinned as ZREG_FP/ZREG_IP). The hardcoded unwind data for
3321+
* CALL VM doesn't match, causing crashes during zend_bailout longjmp rom SEH */
3322+
return;
3323+
#endif
33183324
/* Hardcoded SEH unwind data for JIT-ed PHP functions with "fixed stack frame" */
33193325
static const unsigned char uw_data[] = {
33203326
0x01, // UBYTE: 3 Version , UBYTE: 5 Flags

0 commit comments

Comments
 (0)