Skip to content

Commit 615ebdd

Browse files
committed
Disable frameless calls when observers are enabled
1 parent 6ed86ab commit 615ebdd

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

Zend/zend_compile.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4549,6 +4549,10 @@ static int find_frameless_function_offset(int arity, void *handler)
45494549

45504550
static zend_result zend_compile_frameless_icall(znode *result, zend_ast_list *args, zend_function *fbc, uint32_t type)
45514551
{
4552+
if (ZEND_OBSERVER_ENABLED) {
4553+
return FAILURE;
4554+
}
4555+
45524556
if (type != BP_VAR_R) {
45534557
return FAILURE;
45544558
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
--TEST--
2+
Observer: Frameless calls are disabled when there are observers
3+
--EXTENSIONS--
4+
zend_test
5+
--INI--
6+
zend_test.observer.enabled=1
7+
--FILE--
8+
<?php
9+
function _strpos(string $str) {
10+
return \strpos($str, 1, 1);
11+
}
12+
_strpos('foo');
13+
?>
14+
--EXPECTF--
15+
<!-- init '%s' -->
16+
<!-- init _strpos() -->
17+
<!-- init strpos() -->

0 commit comments

Comments
 (0)