Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Zend/Optimizer/optimize_func_calls.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ static void zend_delete_call_instructions(zend_op_array *op_array, zend_op *opli
case ZEND_DO_ICALL:
case ZEND_DO_UCALL:
case ZEND_DO_FCALL_BY_NAME:
case ZEND_CALLABLE_CONVERT:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

outside of this PR perview of course, but is it me or is it missing in zend opcode too (and _PARTIAL as well) ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't understand what you meant with "missing in zend opcode"?
Also yes, on master this also needs ZEND_CALLABLE_CONVERT_PARTIAL, but that opcode only exists on master

@devnexen devnexen Sep 19, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yes I did not realise it was 8.4 .. so I meant Zend/zend_opcode.c line ~829 (master). But again, maybe I misread.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks like the handling for the NEW opcode, but you can't make an FCC callable (or PFA) for the new invocation. I.e. this is not possible: $closure = new Foo(...);.
So that code should be fine.

call++;
break;
case ZEND_SEND_VAL:
Expand Down
16 changes: 16 additions & 0 deletions ext/opcache/tests/opt/oss_fuzz_546798343.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--TEST--
OSS-Fuzz #546798343 (Heap-buffer-overflow in zend_delete_call_instructions with callable conversion)
--EXTENSIONS--
opcache

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

without the opcache.enable_cli it runs only on CI right ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I'll add the opcache INIs

--FILE--
<?php

$x = function() {};
gonnaBeInlined($x(...));
function gonnaBeInlined($foo) {
}

echo "Done";
?>
--EXPECT--
Done
Loading