Skip to content

Commit c32b7ea

Browse files
committed
Merge remote-tracking branch 'origin/master' into opcache/file_cache_read_only
2 parents 2e614ae + 55e8ebe commit c32b7ea

File tree

19 files changed

+224
-44
lines changed

19 files changed

+224
-44
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
/ext/random @TimWolla @zeriyoshi
4646
/ext/session @Girgias
4747
/ext/simplexml @nielsdos
48+
/ext/soap @nielsdos
4849
/ext/sockets @devnexen
4950
/ext/spl @Girgias
5051
/ext/standard @bukka

EXTENSIONS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,8 @@ SINCE: 5.0
184184
-------------------------------------------------------------------------------
185185
EXTENSION: soap
186186
PRIMARY MAINTAINER: Dmitry Stogov <[email protected]> (2004 - 2018)
187-
MAINTENANCE: Maintained
187+
Niels Dossche <[email protected]> (2024 - 2024)
188+
MAINTENANCE: Odd fixes
188189
STATUS: Working
189190
-------------------------------------------------------------------------------
190191
EXTENSION: xml

Zend/tests/gh16508.phpt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--TEST--
2+
GH-16508: Missing lineno in inheritance errors of delayed early bound classes
3+
--EXTENSIONS--
4+
opcache
5+
--INI--
6+
opcache.enable_cli=1
7+
--FILE--
8+
<?php
9+
10+
new Test2;
11+
12+
class Test2 extends Test {}
13+
14+
abstract class Test {
15+
abstract function foo();
16+
}
17+
18+
?>
19+
--EXPECTF--
20+
Fatal error: Class Test2 contains 1 abstract method and must therefore be declared abstract or implement the remaining method (Test::foo) in %s on line 5

Zend/tests/gh16509.inc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
function test() {
4+
5+
6+
echo 'foo';
7+
}

Zend/tests/gh16509.phpt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--TEST--
2+
GH-16509: Incorrect lineno reported for function redeclaration
3+
--FILE--
4+
<?php
5+
6+
include __DIR__ . '/gh16509.inc';
7+
include __DIR__ . '/gh16509.inc';
8+
9+
?>
10+
--EXPECTF--
11+
Fatal error: Cannot redeclare function test() (previously declared in %sgh16509.inc:3) in %sgh16509.inc on line 3

Zend/tests/gh16515.phpt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
--TEST--
2+
GH-16515: Incorrect propagation of ZEND_ACC_RETURN_REFERENCE for call trampoline
3+
--FILE--
4+
<?php
5+
6+
namespace Foo;
7+
8+
class Foo {
9+
public function &__call($method, $args) {}
10+
}
11+
12+
call_user_func((new Foo)->bar(...));
13+
14+
?>
15+
--EXPECTF--
16+
Notice: Only variable references should be returned by reference in %s on line %d

Zend/zend_closures.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ void zend_closure_from_frame(zval *return_value, zend_execute_data *call) { /* {
871871

872872
memset(&trampoline, 0, sizeof(zend_internal_function));
873873
trampoline.type = ZEND_INTERNAL_FUNCTION;
874-
trampoline.fn_flags = mptr->common.fn_flags & (ZEND_ACC_STATIC | ZEND_ACC_VARIADIC);
874+
trampoline.fn_flags = mptr->common.fn_flags & (ZEND_ACC_STATIC | ZEND_ACC_VARIADIC | ZEND_ACC_RETURN_REFERENCE);
875875
trampoline.handler = zend_closure_call_magic;
876876
trampoline.function_name = mptr->common.function_name;
877877
trampoline.scope = mptr->common.scope;

Zend/zend_compile.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1278,7 +1278,7 @@ static zend_never_inline ZEND_COLD ZEND_NORETURN void do_bind_function_error(zen
12781278
zend_error_noreturn(error_level, "Cannot redeclare function %s() (previously declared in %s:%d)",
12791279
op_array ? ZSTR_VAL(op_array->function_name) : ZSTR_VAL(old_function->common.function_name),
12801280
ZSTR_VAL(old_function->op_array.filename),
1281-
old_function->op_array.opcodes[0].lineno);
1281+
old_function->op_array.line_start);
12821282
} else {
12831283
zend_error_noreturn(error_level, "Cannot redeclare function %s()",
12841284
op_array ? ZSTR_VAL(op_array->function_name) : ZSTR_VAL(old_function->common.function_name));
@@ -8362,6 +8362,7 @@ static zend_op_array *zend_compile_func_decl_ex(
83628362
} else if (toplevel) {
83638363
/* Only register the function after a successful compile */
83648364
if (UNEXPECTED(zend_hash_add_ptr(CG(function_table), lcname, op_array) == NULL)) {
8365+
CG(zend_lineno) = decl->start_lineno;
83658366
do_bind_function_error(lcname, op_array, true);
83668367
}
83678368
}

Zend/zend_inheritance.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3849,6 +3849,8 @@ ZEND_API zend_class_entry *zend_try_early_bind(zend_class_entry *ce, zend_class_
38493849
CG(current_linking_class) = is_cacheable ? ce : NULL;
38503850

38513851
zend_try{
3852+
CG(zend_lineno) = ce->info.user.line_start;
3853+
38523854
if (is_cacheable) {
38533855
zend_begin_record_errors();
38543856
}

Zend/zend_object_handlers.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1614,7 +1614,10 @@ ZEND_API zend_function *zend_get_call_trampoline_func(const zend_class_entry *ce
16141614
func->arg_flags[0] = 0;
16151615
func->arg_flags[1] = 0;
16161616
func->arg_flags[2] = 0;
1617-
func->fn_flags = ZEND_ACC_CALL_VIA_TRAMPOLINE | ZEND_ACC_PUBLIC | ZEND_ACC_VARIADIC;
1617+
func->fn_flags = ZEND_ACC_CALL_VIA_TRAMPOLINE
1618+
| ZEND_ACC_PUBLIC
1619+
| ZEND_ACC_VARIADIC
1620+
| (fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE);
16181621
if (is_static) {
16191622
func->fn_flags |= ZEND_ACC_STATIC;
16201623
}

0 commit comments

Comments
 (0)