This file contains 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
diff --git a/ext/opcache/jit/zend_jit_ir.c b/ext/opcache/jit/zend_jit_ir.c | |
index a3aae9b921f..ca3ac174e5d 100644 | |
--- a/ext/opcache/jit/zend_jit_ir.c | |
+++ b/ext/opcache/jit/zend_jit_ir.c | |
@@ -9353,8 +9353,18 @@ static int zend_jit_init_static_method_call(zend_jit_ctx *jit, | |
if (opline->op1_type == IS_UNUSED | |
&& ((opline->op1.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_PARENT || | |
(opline->op1.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_SELF)) { | |
- if (!op_array->scope || (op_array->fn_flags & ZEND_ACC_STATIC)) { | |
+ if (op_array->fn_flags & ZEND_ACC_STATIC) { |
This file contains 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
diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c | |
index 491d68714b3..20c830db03f 100644 | |
--- a/Zend/zend_inheritance.c | |
+++ b/Zend/zend_inheritance.c | |
@@ -1081,13 +1081,13 @@ static void perform_delayable_implementation_check( | |
/** | |
* @param check_only Set to false to throw compile errors on incompatible methods, or true to return INHERITANCE_ERROR. | |
* @param checked Whether the compatibility check has already succeeded in zend_can_early_bind(). | |
- * @param force_mutable Whether we know that child may be modified, i.e. doesn't live in shm. | |
+ * @param child_zv the zval where the "child" may be cloned. It's NULL if we don't need cloning. |
This file contains 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
diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c | |
index 491d68714b3..155156478bf 100644 | |
--- a/Zend/zend_inheritance.c | |
+++ b/Zend/zend_inheritance.c | |
@@ -1139,6 +1139,13 @@ static zend_always_inline inheritance_status do_inheritance_check_on_method_ex( | |
} | |
if (!check_only && (parent_flags & (ZEND_ACC_PRIVATE|ZEND_ACC_CHANGED))) { | |
+ if (child_scope != ce && child->type == ZEND_USER_FUNCTION && child_zv) { | |
+ /* op_array wasn't duplicated yet */ |
This file contains 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
diff --git a/ext/zend_test/observer.c b/ext/zend_test/observer.c | |
index 3e870de450a..00e6aec877b 100644 | |
--- a/ext/zend_test/observer.c | |
+++ b/ext/zend_test/observer.c | |
@@ -347,6 +347,25 @@ PHP_INI_BEGIN() | |
STD_PHP_INI_BOOLEAN("zend_test.observer.execute_internal", "0", PHP_INI_SYSTEM, OnUpdateBool, observer_execute_internal, zend_zend_test_globals, zend_test_globals) | |
PHP_INI_END() | |
+static void validate_opline_observer_begin(zend_execute_data *ex) | |
+{ |
This file contains 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
diff --git a/Zend/Optimizer/zend_optimizer.c b/Zend/Optimizer/zend_optimizer.c | |
index 463bbbfa84b..523c829fdab 100644 | |
--- a/Zend/Optimizer/zend_optimizer.c | |
+++ b/Zend/Optimizer/zend_optimizer.c | |
@@ -1330,6 +1330,44 @@ static void zend_redo_pass_two_ex(zend_op_array *op_array, zend_ssa *ssa) | |
} | |
break; | |
} | |
+#ifdef ZEND_VERIFY_TYPE_INFERENCE | |
+ if (ssa_op->op1_use >= 0) { |
This file contains 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
diff --git a/Zend/zend_API.c b/Zend/zend_API.c | |
index fd1705149b..d1fe6f12b4 100644 | |
--- a/Zend/zend_API.c | |
+++ b/Zend/zend_API.c | |
@@ -2175,6 +2175,13 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio | |
} | |
while (ptr->fname) { | |
+ if (ptr->flags == ZEND_LIGHT_FUNC) { | |
+ internal_function->light_handler = (zif_light_handler)ptr->handler; |
This file contains 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
diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c | |
index b1fbc7b651..e2a7e599d7 100644 | |
--- a/ext/opcache/jit/zend_jit_trace.c | |
+++ b/ext/opcache/jit/zend_jit_trace.c | |
@@ -6823,7 +6823,8 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par | |
if (!(t->flags & ZEND_JIT_TRACE_USES_INITIAL_IP) | |
|| (ra | |
&& zend_jit_trace_stack_needs_deoptimization(stack, op_array->last_var + op_array->T))) { | |
- uint32_t exit_point = zend_jit_trace_get_exit_point(opline, ZEND_JIT_EXIT_TO_VM); | |
+ /* Deoptimize to the first instruction of the loop */ |
This file contains 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
diff --git a/CODEOWNERS b/CODEOWNERS | |
index 87f1e79d22..c052ac48be 100644 | |
--- a/CODEOWNERS | |
+++ b/CODEOWNERS | |
@@ -9,6 +9,25 @@ | |
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners | |
/.github @iluuu1994 | |
-/ext/opcache @iluuu1994 | |
+/ext/ffi @dstogov |
This file contains 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
diff --git a/Zend/zend_types.h b/Zend/zend_types.h | |
index 6f7fef32a0..151afadec2 100644 | |
--- a/Zend/zend_types.h | |
+++ b/Zend/zend_types.h | |
@@ -726,10 +726,25 @@ static zend_always_inline uint32_t zval_gc_info(uint32_t gc_type_info) { | |
/* Fast class cache */ | |
#define ZSTR_HAS_CE_CACHE(s) (GC_FLAGS(s) & IS_STR_CLASS_NAME_MAP_PTR) | |
-#define ZSTR_GET_CE_CACHE(s) \ | |
- (*(zend_class_entry **)ZEND_MAP_PTR_OFFSET2PTR(GC_REFCOUNT(s))) |
This file contains 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
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h | |
index 9979a9b2fb..a98a3480d3 100644 | |
--- a/Zend/zend_vm_def.h | |
+++ b/Zend/zend_vm_def.h | |
@@ -9857,6 +9857,20 @@ ZEND_VM_HELPER(zend_interrupt_helper, ANY, ANY) | |
zend_timeout(); | |
} else if (zend_interrupt_function) { | |
zend_interrupt_function(execute_data); | |
+ if (EG(exception)) { | |
+ /* We have to UNDEF result, because ZEND_HANDLE_EXCEPTION is going to free it */ |
NewerOlder