diff options
Diffstat (limited to 'vld-upstream.patch')
-rw-r--r-- | vld-upstream.patch | 124 |
1 files changed, 114 insertions, 10 deletions
diff --git a/vld-upstream.patch b/vld-upstream.patch index b57e4de..5764235 100644 --- a/vld-upstream.patch +++ b/vld-upstream.patch @@ -1,7 +1,7 @@ From 850d2d82c293e52cf0ef57e6cc762617fcc09979 Mon Sep 17 00:00:00 2001 From: Derick Rethans <github@derickrethans.nl> Date: Mon, 10 Oct 2022 16:47:13 +0100 -Subject: [PATCH 1/5] Fixed crash with CATCH on PHP 8.2 with 32-bit +Subject: [PATCH 1/6] Fixed crash with CATCH on PHP 8.2 with 32-bit --- branchinfo.c | 10 +++++++--- @@ -37,12 +37,12 @@ index 3547c1b..bddd9ff 100644 branch_info->branches[i].start_lineno, branch_info->branches[i].end_lineno -- -2.45.2 +2.46.0 From 298cea2f3880cdc775fddbdb4fcb334e1f19bfc5 Mon Sep 17 00:00:00 2001 From: Derick Rethans <github@derickrethans.nl> Date: Fri, 16 Dec 2022 10:27:40 +0000 -Subject: [PATCH 2/5] Fixed showing the JMP for the 'default' (or error) case +Subject: [PATCH 2/6] Fixed showing the JMP for the 'default' (or error) case in MATCH instructions --- @@ -63,12 +63,12 @@ index 9fc75d4..54661c3 100644 /* 197 */ { "MATCH_ERROR", ALL_USED }, /* 198 */ { "JMP_NULL", ALL_USED }, -- -2.45.2 +2.46.0 From 7d25f1e5949935aa153b37d6bdaf19cf8079772a Mon Sep 17 00:00:00 2001 From: Derick Rethans <github@derickrethans.nl> Date: Tue, 28 May 2024 15:09:58 +0100 -Subject: [PATCH 3/5] RECV uses OP2_OPNUM too +Subject: [PATCH 3/6] RECV uses OP2_OPNUM too --- srm_oparray.c | 5 ++++- @@ -98,12 +98,12 @@ index 54661c3..1df6f06 100644 return flags; } -- -2.45.2 +2.46.0 From d7abb0c5ebda8277cda4be37a92d55e29ab5b503 Mon Sep 17 00:00:00 2001 From: Derick Rethans <github@derickrethans.nl> Date: Tue, 28 May 2024 15:11:24 +0100 -Subject: [PATCH 4/5] PHP_CHECK_GCC_ARG is now AX_CHECK_COMPILE_FLAG +Subject: [PATCH 4/6] PHP_CHECK_GCC_ARG is now AX_CHECK_COMPILE_FLAG --- config.m4 | 72 +++++++++++++++++++++++++++---------------------------- @@ -193,12 +193,12 @@ index 54b914d..18cfa7d 100644 MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS" STD_CFLAGS="-g -O0 -Wall" -- -2.45.2 +2.46.0 From df1c52c4cb62e5ff31e1b72e3f11df9a45ee567a Mon Sep 17 00:00:00 2001 From: Derick Rethans <github@derickrethans.nl> Date: Wed, 26 Jun 2024 16:58:42 +0100 -Subject: [PATCH 5/5] Add support for PHP 8.4 opcodes ZEND_JMP_FRAMELESS and +Subject: [PATCH 5/6] Add support for PHP 8.4 opcodes ZEND_JMP_FRAMELESS and ZEND_FRAMELESS_ICALL_[0-3] --- @@ -295,5 +295,109 @@ index 0000000..f693565 + +} -- -2.45.2 +2.46.0 + +From dc56f73a25b0230745afb5523871f2e8dd33fccd Mon Sep 17 00:00:00 2001 +From: Derick Rethans <github@derickrethans.nl> +Date: Thu, 22 Aug 2024 14:00:23 +0100 +Subject: [PATCH 6/6] PHP 8.4: Support for opcode-less exit + +Copied over from the Xdebug implementation. + +Fixes #83: minimal fix for 8.4.0beta3 +--- + srm_oparray.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 48 insertions(+), 2 deletions(-) + +diff --git a/srm_oparray.c b/srm_oparray.c +index 3bd6dce..2669697 100644 +--- a/srm_oparray.c ++++ b/srm_oparray.c +@@ -1108,15 +1108,17 @@ int vld_find_jumps(zend_op_array *opa, unsigned int position, size_t *jump_count + + #if PHP_VERSION_ID >= 80400 + } else if (opcode.opcode == ZEND_JMP_FRAMELESS) { +- jumps[0] = VLD_ZNODE_JMP_LINE(opcode.op2, position, base_address); +- jumps[1] = position + 1; ++ jumps[0] = position + 1; ++ jumps[1] = VLD_ZNODE_JMP_LINE(opcode.op2, position, base_address); + *jump_count = 2; + return 1; + #endif + + } else if ( + opcode.opcode == ZEND_GENERATOR_RETURN || ++#if PHP_VERSION_ID < 80400 + opcode.opcode == ZEND_EXIT || ++#endif + opcode.opcode == ZEND_THROW || + #if PHP_VERSION_ID >= 80000 + opcode.opcode == ZEND_MATCH_ERROR || +@@ -1126,6 +1128,48 @@ int vld_find_jumps(zend_op_array *opa, unsigned int position, size_t *jump_count + jumps[0] = VLD_JMP_EXIT; + *jump_count = 1; + return 1; ++ } else if ( ++ opcode.opcode == ZEND_INIT_FCALL ++ ) { ++ zval *func_name = RT_CONSTANT(&opa->opcodes[position], opcode.op2); ++ if (zend_string_equals_literal(Z_PTR_P(func_name), "exit")) { ++ int level = 0; ++ uint32_t start = position + 1; ++ ++ for (;;) { ++ switch (opa->opcodes[start].opcode) { ++ case ZEND_INIT_FCALL: ++ case ZEND_INIT_FCALL_BY_NAME: ++ case ZEND_INIT_NS_FCALL_BY_NAME: ++ case ZEND_INIT_DYNAMIC_CALL: ++ case ZEND_INIT_USER_CALL: ++ case ZEND_INIT_METHOD_CALL: ++ case ZEND_INIT_STATIC_METHOD_CALL: ++#if PHP_VERSION_ID >= 80400 ++ case ZEND_INIT_PARENT_PROPERTY_HOOK_CALL: ++#endif ++ case ZEND_NEW: ++ level++; ++ break; ++ case ZEND_DO_FCALL: ++ case ZEND_DO_FCALL_BY_NAME: ++ case ZEND_DO_ICALL: ++ case ZEND_DO_UCALL: ++ if (level == 0) { ++ goto done; ++ } ++ level--; ++ break; ++ } ++ start++; ++ } ++ done: ++ ZEND_ASSERT(opa->opcodes[start].opcode == ZEND_DO_ICALL); ++ jumps[0] = VLD_JMP_EXIT; ++ *jump_count = 1; ++ return 1; ++ } ++ + #if PHP_VERSION_ID >= 70200 + } else if ( + # if PHP_VERSION_ID >= 80000 +@@ -1265,6 +1309,7 @@ void vld_analyse_branch(zend_op_array *opa, unsigned int position, vld_set *set, + break; + } + ++#if PHP_VERSION_ID < 80400 + /* See if we have an exit instruction */ + if (opa->opcodes[position].opcode == ZEND_EXIT) { + VLD_PRINT(1, "Exit found\n"); +@@ -1272,6 +1317,7 @@ void vld_analyse_branch(zend_op_array *opa, unsigned int position, vld_set *set, + branch_info->branches[position].start_lineno = opa->opcodes[position].lineno; + break; + } ++#endif + /* See if we have a return instruction */ + if ( + opa->opcodes[position].opcode == ZEND_RETURN +-- +2.46.0 |