]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.3' into PHP-7.4
authorNikita Popov <nikita.ppv@gmail.com>
Thu, 29 Aug 2019 10:34:07 +0000 (12:34 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Thu, 29 Aug 2019 10:34:07 +0000 (12:34 +0200)
1  2 
Zend/zend_vm_def.h
Zend/zend_vm_execute.h

index c10f9d6169c04f604582210e75c7acf42640038b,99b731b11a94c4542ce9745e814738c5cd0ba1cf..aa7a80c95c071daf11bcd1da1fe40371608b0234
@@@ -2909,8 -2430,22 +2909,13 @@@ ZEND_VM_HOT_HELPER(zend_leave_helper, A
                        zend_clean_and_cache_symbol_table(EX(symbol_table));
                }
                EG(current_execute_data) = EX(prev_execute_data);
+               /* Free extra args before releasing the closure,
+                * as that may free the op_array. */
+               zend_vm_stack_free_extra_args_ex(call_info, execute_data);
                if (UNEXPECTED(call_info & ZEND_CALL_RELEASE_THIS)) {
 -                      zend_object *object = Z_OBJ(execute_data->This);
 -#if 0
 -                      if (UNEXPECTED(EG(exception) != NULL) && (EX(opline)->op1.num & ZEND_CALL_CTOR)) {
 -#else
 -                      if (UNEXPECTED(EG(exception) != NULL) && (call_info & ZEND_CALL_CTOR)) {
 -#endif
 -                              GC_DELREF(object);
 -                              zend_object_store_ctor_failed(object);
 -                      }
 -                      OBJ_RELEASE(object);
 +                      OBJ_RELEASE(Z_OBJ(execute_data->This));
                } else if (UNEXPECTED(call_info & ZEND_CALL_CLOSURE)) {
                        OBJ_RELEASE(ZEND_CLOSURE_OBJECT(EX(func)));
                }
index 6ac1d09e8f5644e21648a02774abce418721261d,b29f5bddc6c2cd18eb4120e7b1b3868a765de3eb..6bc3bb2e9452733e8e69abf953625f2408e8324a
@@@ -1173,8 -541,22 +1173,13 @@@ static zend_never_inline ZEND_OPCODE_HA
                        zend_clean_and_cache_symbol_table(EX(symbol_table));
                }
                EG(current_execute_data) = EX(prev_execute_data);
+               /* Free extra args before releasing the closure,
+                * as that may free the op_array. */
+               zend_vm_stack_free_extra_args_ex(call_info, execute_data);
                if (UNEXPECTED(call_info & ZEND_CALL_RELEASE_THIS)) {
 -                      zend_object *object = Z_OBJ(execute_data->This);
 -#if 0
 -                      if (UNEXPECTED(EG(exception) != NULL) && (EX(opline)->op1.num & ZEND_CALL_CTOR)) {
 -#else
 -                      if (UNEXPECTED(EG(exception) != NULL) && (call_info & ZEND_CALL_CTOR)) {
 -#endif
 -                              GC_DELREF(object);
 -                              zend_object_store_ctor_failed(object);
 -                      }
 -                      OBJ_RELEASE(object);
 +                      OBJ_RELEASE(Z_OBJ(execute_data->This));
                } else if (UNEXPECTED(call_info & ZEND_CALL_CLOSURE)) {
                        OBJ_RELEASE(ZEND_CLOSURE_OBJECT(EX(func)));
                }
@@@ -53366,8 -55379,22 +53370,13 @@@ zend_leave_helper_SPEC_LABEL
                        zend_clean_and_cache_symbol_table(EX(symbol_table));
                }
                EG(current_execute_data) = EX(prev_execute_data);
+               /* Free extra args before releasing the closure,
+                * as that may free the op_array. */
+               zend_vm_stack_free_extra_args_ex(call_info, execute_data);
                if (UNEXPECTED(call_info & ZEND_CALL_RELEASE_THIS)) {
 -                      zend_object *object = Z_OBJ(execute_data->This);
 -#if 0
 -                      if (UNEXPECTED(EG(exception) != NULL) && (EX(opline)->op1.num & ZEND_CALL_CTOR)) {
 -#else
 -                      if (UNEXPECTED(EG(exception) != NULL) && (call_info & ZEND_CALL_CTOR)) {
 -#endif
 -                              GC_DELREF(object);
 -                              zend_object_store_ctor_failed(object);
 -                      }
 -                      OBJ_RELEASE(object);
 +                      OBJ_RELEASE(Z_OBJ(execute_data->This));
                } else if (UNEXPECTED(call_info & ZEND_CALL_CLOSURE)) {
                        OBJ_RELEASE(ZEND_CLOSURE_OBJECT(EX(func)));
                }