summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2025-07-02 11:02:36 +0200
committerRemi Collet <remi@php.net>2025-07-02 11:02:36 +0200
commita0da1e489bc2460cbee055922030e863f065ead2 (patch)
treeabaeb77ad7a3432d20c8f42d73607756adafe64c
parentdc8d8908601a381e5a9ae6f5055a2fe1e443752d (diff)
update to 0.19.0HEADmaster
re-license spec file to CECILL-2.1
-rw-r--r--REFLECTION2
-rw-r--r--php-pecl-vld.spec34
-rw-r--r--vld-upstream.patch403
3 files changed, 18 insertions, 421 deletions
diff --git a/REFLECTION b/REFLECTION
index e7cf2c3..e7137bf 100644
--- a/REFLECTION
+++ b/REFLECTION
@@ -1,4 +1,4 @@
-Extension [ <persistent> extension #125 vld version 0.18.0 ] {
+Extension [ <persistent> extension #121 vld version 0.19.0 ] {
- INI {
Entry [ vld.active <SYSTEM> ]
diff --git a/php-pecl-vld.spec b/php-pecl-vld.spec
index c46fae0..10b5bc0 100644
--- a/php-pecl-vld.spec
+++ b/php-pecl-vld.spec
@@ -1,19 +1,17 @@
# remirepo spec file for php-pecl-vld
#
-# Copyright (c) 2013-2024 Remi Collet
-# License: CC-BY-SA-4.0
-# http://creativecommons.org/licenses/by-sa/4.0/
+# SPDX-FileCopyrightText: Copyright 2013-2025 Remi Collet
+# SPDX-License-Identifier: CECILL-2.1
+# http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
#
# Please, preserve the changelog entries
#
%{?scl:%scl_package php-pecl-vld}
-%global gh_commit 8146d47ed5883c0b7cb9c5ce980892ce286cd916
-%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
-%global gh_owner derickr
-%global gh_project vld
%global pecl_name vld
+%global pie_vend derickr
+%global pie_proj vld
%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
%global ini_name 40-%{pecl_name}.ini
%global sources %{pecl_name}-%{version}
@@ -22,13 +20,11 @@
Summary: Dump the internal representation of PHP scripts
Name: %{?scl_prefix}php-pecl-%{pecl_name}
License: PHP-3.01
-Version: 0.18.0
-Release: 6%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
+Version: 0.19.0
+Release: 1%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
URL: https://pecl.php.net/package/%{pecl_name}
Source0: https://pecl.php.net/get/%{sources}.tgz
-Patch0: %{pecl_name}-upstream.patch
-
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
BuildRequires: %{?scl_prefix}php-devel >= 7.0
@@ -37,10 +33,12 @@ BuildRequires: %{?scl_prefix}php-pear
Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires: %{?scl_prefix}php(api) = %{php_core_api}
-Provides: %{?scl_prefix}php-%{pecl_name} = %{version}
-Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}
-Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version}
-Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version}
+Provides: %{?scl_prefix}php-%{pecl_name} = %{version}
+Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}
+Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version}
+Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version}
+Provides: %{?scl_prefix}php-pie(%{pie_vend}/%{pie_proj}) = %{version}
+Provides: %{?scl_prefix}php-%{pie_vend}-%{pie_proj} = %{version}
%description
@@ -56,8 +54,6 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
sed -e '/LICENSE/s/role="doc"/role="src"/' -i package.xml
pushd %{sources}
-%patch -P0 -p1
-
#: Fix version
#sed -e 's/"0.16.0"/"%{version}"/' -i vld.c
@@ -165,6 +161,10 @@ done
%changelog
+* Wed Jul 2 2025 Remi Collet <remi@remirepo.net> - 0.19.0-1
+- update to 0.19.0
+- re-license spec file to CECILL-2.1
+
* Tue Sep 24 2024 Remi Collet <remi@remirepo.net> - 0.18.0-6
- rebuild for 8.4.0RC1
diff --git a/vld-upstream.patch b/vld-upstream.patch
deleted file mode 100644
index 5764235..0000000
--- a/vld-upstream.patch
+++ /dev/null
@@ -1,403 +0,0 @@
-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/6] Fixed crash with CATCH on PHP 8.2 with 32-bit
-
----
- branchinfo.c | 10 +++++++---
- 1 file changed, 7 insertions(+), 3 deletions(-)
-
-diff --git a/branchinfo.c b/branchinfo.c
-index 3547c1b..bddd9ff 100644
---- a/branchinfo.c
-+++ b/branchinfo.c
-@@ -113,7 +113,11 @@ void vld_branch_post_process(zend_op_array *opa, vld_branch_info *branch_info)
- if (vld_set_in(branch_info->entry_points, i) && opa->opcodes[i].opcode == ZEND_CATCH) {
- #if PHP_VERSION_ID >= 70300
- # if ZEND_USE_ABS_JMP_ADDR
-+# if PHP_VERSION_ID >= 80200
-+ if (opa->opcodes[i].op2.jmp_addr != -1) {
-+# else
- if (opa->opcodes[i].op2.jmp_addr != NULL) {
-+# endif
- # else
- if (opa->opcodes[i].op2.jmp_offset != 0) {
- # endif
-@@ -264,9 +268,9 @@ void vld_branch_info_dump(zend_op_array *opa, vld_branch_info *branch_info)
- for (i = 0; i < branch_info->starts->size; i++) {
- if (vld_set_in(branch_info->starts, i)) {
- fprintf(
-- VLD_G(path_dump_file),
-- "\t\"%s_%d\" [ label = \"{ op #%d-%d | line %d-%d }\" ];\n",
-- fname, i, i,
-+ VLD_G(path_dump_file),
-+ "\t\"%s_%d\" [ label = \"{ op #%d-%d | line %d-%d }\" ];\n",
-+ fname, i, i,
- branch_info->branches[i].end_op,
- branch_info->branches[i].start_lineno,
- branch_info->branches[i].end_lineno
---
-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/6] Fixed showing the JMP for the 'default' (or error) case
- in MATCH instructions
-
----
- srm_oparray.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/srm_oparray.c b/srm_oparray.c
-index 9fc75d4..54661c3 100644
---- a/srm_oparray.c
-+++ b/srm_oparray.c
-@@ -341,7 +341,7 @@ static const op_usage opcodes[] = {
- # if PHP_VERSION_ID >= 70400
- /* 194 */ { "ARRAY_KEY_EXISTS", ALL_USED },
- # if PHP_VERSION_ID >= 80000
-- /* 195 */ { "MATCH", ALL_USED | OP2_JMP_ARRAY },
-+ /* 195 */ { "MATCH", ALL_USED | OP2_JMP_ARRAY | EXT_VAL_JMP_REL },
- /* 196 */ { "CASE_STRICT", ALL_USED },
- /* 197 */ { "MATCH_ERROR", ALL_USED },
- /* 198 */ { "JMP_NULL", ALL_USED },
---
-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/6] RECV uses OP2_OPNUM too
-
----
- srm_oparray.c | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/srm_oparray.c b/srm_oparray.c
-index 54661c3..1df6f06 100644
---- a/srm_oparray.c
-+++ b/srm_oparray.c
-@@ -145,7 +145,7 @@ static const op_usage opcodes[] = {
- /* 60 */ { "DO_FCALL", SPECIAL },
- /* 61 */ { "INIT_FCALL", ALL_USED },
- /* 62 */ { "RETURN", OP1_USED },
-- /* 63 */ { "RECV", RES_USED | OP1_USED },
-+ /* 63 */ { "RECV", RES_USED | OP1_USED | OP2_OPNUM },
- /* 64 */ { "RECV_INIT", ALL_USED },
- /* 65 */ { "SEND_VAL", OP1_USED },
- /* 66 */ { "SEND_VAR_EX", ALL_USED },
-@@ -649,6 +649,9 @@ static unsigned int vld_get_special_flags(const zend_op *op, unsigned int base_a
- }
- #endif
- break;
-+ case ZEND_RECV:
-+ flags = OP1_USED|OP2_USED|OP2_OPNUM;
-+ break;
- }
- return flags;
- }
---
-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/6] PHP_CHECK_GCC_ARG is now AX_CHECK_COMPILE_FLAG
-
----
- config.m4 | 72 +++++++++++++++++++++++++++----------------------------
- 1 file changed, 36 insertions(+), 36 deletions(-)
-
-diff --git a/config.m4 b/config.m4
-index 54b914d..18cfa7d 100644
---- a/config.m4
-+++ b/config.m4
-@@ -20,42 +20,42 @@ if test "$PHP_VLD" != "no"; then
- CPPFLAGS=$old_CPPFLAGS
-
- if test "$PHP_VLD_DEV" = "yes"; then
-- PHP_CHECK_GCC_ARG(-Wbool-conversion, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wbool-conversion")
-- PHP_CHECK_GCC_ARG(-Wdeclaration-after-statement, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wdeclaration-after-statement")
-- PHP_CHECK_GCC_ARG(-Wdiscarded-qualifiers, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wdiscarded-qualifiers")
-- PHP_CHECK_GCC_ARG(-Wduplicate-enum, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wduplicate-enum")
-- PHP_CHECK_GCC_ARG(-Wempty-body, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wempty-body")
-- PHP_CHECK_GCC_ARG(-Wenum-compare, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wenum-compare")
-- PHP_CHECK_GCC_ARG(-Werror, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Werror")
-- PHP_CHECK_GCC_ARG(-Wextra, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wextra")
-- PHP_CHECK_GCC_ARG(-Wformat-nonliteral, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wformat-nonliteral")
-- PHP_CHECK_GCC_ARG(-Wformat-security, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wformat-security")
-- PHP_CHECK_GCC_ARG(-Wheader-guard, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wheader-guard")
-- PHP_CHECK_GCC_ARG(-Wincompatible-pointer-types-discards-qualifiers, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wincompatible-pointer-types-discards-qualifiers")
-- PHP_CHECK_GCC_ARG(-Wimplicit-fallthrough, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wimplicit-fallthrough")
-- PHP_CHECK_GCC_ARG(-Winit-self, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Winit-self")
-- PHP_CHECK_GCC_ARG(-Wlogical-not-parentheses, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wlogical-not-parentheses")
-- PHP_CHECK_GCC_ARG(-Wlogical-op, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wlogical-op")
-- PHP_CHECK_GCC_ARG(-Wlogical-op-parentheses, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wlogical-op-parentheses")
-- PHP_CHECK_GCC_ARG(-Wloop-analysis, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wloop-analysis")
-- PHP_CHECK_GCC_ARG(-Wmaybe-uninitialized, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wmaybe-uninitialized")
-- PHP_CHECK_GCC_ARG(-Wmissing-format-attribute, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wmissing-format-attribute")
-- PHP_CHECK_GCC_ARG(-Wno-missing-field-initializers, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wno-missing-field-initializers")
-- PHP_CHECK_GCC_ARG(-Wno-sign-compare, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wno-sign-compare")
-- PHP_CHECK_GCC_ARG(-Wno-unused-but-set-variable, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wno-unused-but-set-variable")
-- PHP_CHECK_GCC_ARG(-Wno-unused-parameter, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wno-unused-parameter")
-- PHP_CHECK_GCC_ARG(-Wno-variadic-macros, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wno-variadic-macros")
-- PHP_CHECK_GCC_ARG(-Wparentheses, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wparentheses")
-- PHP_CHECK_GCC_ARG(-Wpointer-bool-conversion, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wpointer-bool-conversion")
-- PHP_CHECK_GCC_ARG(-Wsizeof-array-argument, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wsizeof-array-argument")
-- PHP_CHECK_GCC_ARG(-Wstring-conversion, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wstring-conversion")
-- PHP_CHECK_GCC_ARG(-Wwrite-strings, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wwrite-strings")
-- PHP_CHECK_GCC_ARG(-fdiagnostics-show-option, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -fdiagnostics-show-option")
-- PHP_CHECK_GCC_ARG(-fno-exceptions, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -fno-exceptions")
-- PHP_CHECK_GCC_ARG(-fno-omit-frame-pointer, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -fno-omit-frame-pointer")
-- PHP_CHECK_GCC_ARG(-fno-optimize-sibling-calls, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -fno-optimize-sibling-calls")
-- PHP_CHECK_GCC_ARG(-fsanitize-address, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -fsanitize-address")
-- PHP_CHECK_GCC_ARG(-fstack-protector, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -fstack-protector")
-+ AX_CHECK_COMPILE_FLAG(-Wbool-conversion, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wbool-conversion")
-+ AX_CHECK_COMPILE_FLAG(-Wdeclaration-after-statement, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wdeclaration-after-statement")
-+ AX_CHECK_COMPILE_FLAG(-Wdiscarded-qualifiers, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wdiscarded-qualifiers")
-+ AX_CHECK_COMPILE_FLAG(-Wduplicate-enum, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wduplicate-enum")
-+ AX_CHECK_COMPILE_FLAG(-Wempty-body, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wempty-body")
-+ AX_CHECK_COMPILE_FLAG(-Wenum-compare, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wenum-compare")
-+ AX_CHECK_COMPILE_FLAG(-Werror, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Werror")
-+ AX_CHECK_COMPILE_FLAG(-Wextra, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wextra")
-+ AX_CHECK_COMPILE_FLAG(-Wformat-nonliteral, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wformat-nonliteral")
-+ AX_CHECK_COMPILE_FLAG(-Wformat-security, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wformat-security")
-+ AX_CHECK_COMPILE_FLAG(-Wheader-guard, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wheader-guard")
-+ AX_CHECK_COMPILE_FLAG(-Wincompatible-pointer-types-discards-qualifiers, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wincompatible-pointer-types-discards-qualifiers")
-+ AX_CHECK_COMPILE_FLAG(-Wimplicit-fallthrough, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wimplicit-fallthrough")
-+ AX_CHECK_COMPILE_FLAG(-Winit-self, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Winit-self")
-+ AX_CHECK_COMPILE_FLAG(-Wlogical-not-parentheses, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wlogical-not-parentheses")
-+ AX_CHECK_COMPILE_FLAG(-Wlogical-op, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wlogical-op")
-+ AX_CHECK_COMPILE_FLAG(-Wlogical-op-parentheses, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wlogical-op-parentheses")
-+ AX_CHECK_COMPILE_FLAG(-Wloop-analysis, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wloop-analysis")
-+ AX_CHECK_COMPILE_FLAG(-Wmaybe-uninitialized, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wmaybe-uninitialized")
-+ AX_CHECK_COMPILE_FLAG(-Wmissing-format-attribute, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wmissing-format-attribute")
-+ AX_CHECK_COMPILE_FLAG(-Wno-missing-field-initializers, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wno-missing-field-initializers")
-+ AX_CHECK_COMPILE_FLAG(-Wno-sign-compare, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wno-sign-compare")
-+ AX_CHECK_COMPILE_FLAG(-Wno-unused-but-set-variable, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wno-unused-but-set-variable")
-+ AX_CHECK_COMPILE_FLAG(-Wno-unused-parameter, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wno-unused-parameter")
-+ AX_CHECK_COMPILE_FLAG(-Wno-variadic-macros, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wno-variadic-macros")
-+ AX_CHECK_COMPILE_FLAG(-Wparentheses, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wparentheses")
-+ AX_CHECK_COMPILE_FLAG(-Wpointer-bool-conversion, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wpointer-bool-conversion")
-+ AX_CHECK_COMPILE_FLAG(-Wsizeof-array-argument, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wsizeof-array-argument")
-+ AX_CHECK_COMPILE_FLAG(-Wstring-conversion, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wstring-conversion")
-+ AX_CHECK_COMPILE_FLAG(-Wwrite-strings, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wwrite-strings")
-+ AX_CHECK_COMPILE_FLAG(-fdiagnostics-show-option, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -fdiagnostics-show-option")
-+ AX_CHECK_COMPILE_FLAG(-fno-exceptions, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -fno-exceptions")
-+ AX_CHECK_COMPILE_FLAG(-fno-omit-frame-pointer, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -fno-omit-frame-pointer")
-+ AX_CHECK_COMPILE_FLAG(-fno-optimize-sibling-calls, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -fno-optimize-sibling-calls")
-+ AX_CHECK_COMPILE_FLAG(-fsanitize-address, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -fsanitize-address")
-+ AX_CHECK_COMPILE_FLAG(-fstack-protector, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -fstack-protector")
-
- MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS"
- STD_CFLAGS="-g -O0 -Wall"
---
-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/6] Add support for PHP 8.4 opcodes ZEND_JMP_FRAMELESS and
- ZEND_FRAMELESS_ICALL_[0-3]
-
----
- srm_oparray.c | 29 +++++++++++++++++++++++++++++
- srm_oparray.h | 2 ++
- tests/jmp_frameless.inc | 6 ++++++
- 3 files changed, 37 insertions(+)
- create mode 100644 tests/jmp_frameless.inc
-
-diff --git a/srm_oparray.c b/srm_oparray.c
-index 1df6f06..3bd6dce 100644
---- a/srm_oparray.c
-+++ b/srm_oparray.c
-@@ -350,6 +350,16 @@ static const op_usage opcodes[] = {
- /* 200 */ { "FETCH_GLOBALS", ALL_USED },
- /* 201 */ { "VERIFY_NEVER_TYPE", ALL_USED },
- /* 202 */ { "ZEND_CALLABLE_CONVERT", ALL_USED },
-+# if PHP_VERSION_ID >= 80300
-+ /* 203 */ { "ZEND_BIND_INIT_STATIC_OR_JMP", ALL_USED },
-+# if PHP_VERSION_ID >= 80400
-+ /* 204 */ { "ZEND_FRAMELESS_ICALL_0", ALL_USED | EXT_VAL_FLF },
-+ /* 205 */ { "ZEND_FRAMELESS_ICALL_1", ALL_USED | EXT_VAL_FLF },
-+ /* 206 */ { "ZEND_FRAMELESS_ICALL_2", ALL_USED | EXT_VAL_FLF },
-+ /* 207 */ { "ZEND_FRAMELESS_ICALL_3", ALL_USED | EXT_VAL_FLF },
-+ /* 208 */ { "ZEND_JMP_FRAMELESS", ALL_USED | EXT_CACHED_PTR | OP2_OPNUM },
-+# endif
-+# endif
- # endif
- # endif
- # else
-@@ -814,6 +824,12 @@ void vld_dump_op(int nr, zend_op * op_ptr, unsigned int base_address, int notdea
- last_lineno = op.lineno;
- }
-
-+#if PHP_VERSION_ID >= 80400
-+ if (flags & EXT_VAL_FLF) {
-+ fetch_type = (char*) ZEND_FLF_FUNC(&op)->common.function_name->val;
-+ }
-+#endif
-+
- if (op.opcode >= NUM_KNOWN_OPCODES) {
- if (VLD_G(format)) {
- vld_printf(stderr, "%5d %s %c %c %c %c %s <%03d>%-23s %s %-14s ", nr, VLD_G(col_sep), notdead ? ' ' : '*', entry ? 'E' : ' ', start ? '>' : ' ', end ? '>' : ' ', VLD_G(col_sep), op.opcode, VLD_G(col_sep), fetch_type);
-@@ -834,6 +850,11 @@ void vld_dump_op(int nr, zend_op * op_ptr, unsigned int base_address, int notdea
- }
- }
-
-+#if PHP_VERSION_ID >= 80400
-+ if (flags & EXT_CACHED_PTR) {
-+ vld_printf(stderr, "s%-3d ", op.extended_value);
-+ } else
-+#endif
- if (flags & EXT_VAL) {
- #if PHP_VERSION_ID >= 70300
- if (op.opcode == ZEND_CATCH) {
-@@ -1085,6 +1106,14 @@ int vld_find_jumps(zend_op_array *opa, unsigned int position, size_t *jump_count
- *jump_count = 1;
- return 1;
-
-+#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;
-+ *jump_count = 2;
-+ return 1;
-+#endif
-+
- } else if (
- opcode.opcode == ZEND_GENERATOR_RETURN ||
- opcode.opcode == ZEND_EXIT ||
-diff --git a/srm_oparray.h b/srm_oparray.h
-index 7cc0803..ee65c25 100644
---- a/srm_oparray.h
-+++ b/srm_oparray.h
-@@ -57,6 +57,8 @@
- #define EXT_VAL_JMP_ABS 1<<25
- #define VLD_IS_JMP_ARRAY 1<<26
- #define VLD_IS_INDEX 1<<27
-+#define EXT_VAL_FLF 1<<28
-+#define EXT_CACHED_PTR 1<<29
-
- typedef struct _op_usage {
- const char *name;
-diff --git a/tests/jmp_frameless.inc b/tests/jmp_frameless.inc
-new file mode 100644
-index 0000000..f693565
---- /dev/null
-+++ b/tests/jmp_frameless.inc
-@@ -0,0 +1,6 @@
-+<?php
-+namespace Foo {
-+
-+echo substr("Derick Cool?", 7);
-+
-+}
---
-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
-