Skip to content

Commit

Permalink
Fix bug #73654
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Dec 5, 2016
1 parent 2f0e61f commit 3b79f8f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
3 changes: 2 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2017, PHP 7.1.1


- Opcache:
. Fixed bug #73654 (Segmentation fault in zend_call_function). (Nikita)

01 Dec 2016, PHP 7.1.0

Expand Down
5 changes: 5 additions & 0 deletions ext/opcache/Optimizer/zend_optimizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,11 @@ int zend_optimizer_update_op1_const(zend_op_array *op_array,
case ZEND_SEND_VAR_NO_REF_EX:
zval_ptr_dtor(val);
return 0;
case ZEND_VERIFY_RETURN_TYPE:
/* This would require a non-local change.
* zend_optimizer_replace_by_const() supports this. */
zval_ptr_dtor(val);
return 0;
case ZEND_CONCAT:
case ZEND_FAST_CONCAT:
case ZEND_FETCH_R:
Expand Down
17 changes: 17 additions & 0 deletions ext/opcache/tests/bug73654.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
--TEST--
Bug #73654: Segmentation fault in zend_call_function
--FILE--
<?php
echo xyz();

function x () : string {
return 'x';
}

function xyz() : string {
return x().'yz';
}

?>
--EXPECT--
xyz

0 comments on commit 3b79f8f

Please sign in to comment.