Skip to content

Commit 05b63b1

Browse files
committed
Don't check "fake" closures (fix assertion)
Fixes oss-fuzz #53078
1 parent de4b502 commit 05b63b1

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
--TEST--
2+
First class callables and &__call()
3+
--FILE--
4+
<?php
5+
class Foo {
6+
public function &__call($method, $args) {
7+
return $method;
8+
}
9+
}
10+
11+
$foo = new Foo;
12+
$bar = $foo->bar(...);
13+
echo $bar(),"\n";
14+
?>
15+
--EXPECT--
16+
bar

Zend/zend_vm_def.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4166,7 +4166,7 @@ ZEND_VM_HOT_HANDLER(60, ZEND_DO_FCALL, ANY, ANY, SPEC(RETVAL,OBSERVER))
41664166
}
41674167

41684168
#if ZEND_DEBUG
4169-
if (!EG(exception) && call->func) {
4169+
if (!EG(exception) && call->func && !(call->func->common.fn_flags & ZEND_ACC_FAKE_CLOSURE)) {
41704170
if (should_throw) {
41714171
zend_internal_call_arginfo_violation(call->func);
41724172
}

Zend/zend_vm_execute.h

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)