Skip to content

Commit

Permalink
Fixed bug #80030
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Aug 31, 2020
1 parent 570f463 commit 5097564
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ PHP NEWS
- Fileinfo:
. Upgrade to libmagic 5.39. (Anatol)

- Opcache:
. Fixed bug #80030 (Optimizer segfault with isset on static property with
undef dynamic class name). (Nikita)

20 Aug 2020, PHP 8.0.0beta2

- SPL:
Expand Down
19 changes: 19 additions & 0 deletions Zend/tests/bug80030.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
--TEST--
Bug #80030: Optimizer segfault with isset on static property with undef dynamic class name
--FILE--
<?php

function test() {
var_dump(isset($className::$test));
}
test();

?>
--EXPECTF--
Warning: Undefined variable $className in %s on line %d

Fatal error: Uncaught Error: Class name must be a valid object or a string in %s:%d
Stack trace:
#0 %s(%d): test()
#1 {main}
thrown in %s on line %d
1 change: 1 addition & 0 deletions ext/opcache/Optimizer/zend_optimizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ int zend_optimizer_update_op2_const(zend_op_array *op_array,
case ZEND_FETCH_STATIC_PROP_UNSET:
case ZEND_FETCH_STATIC_PROP_FUNC_ARG:
case ZEND_UNSET_STATIC_PROP:
case ZEND_ISSET_ISEMPTY_STATIC_PROP:
case ZEND_PRE_INC_STATIC_PROP:
case ZEND_PRE_DEC_STATIC_PROP:
case ZEND_POST_INC_STATIC_PROP:
Expand Down

0 comments on commit 5097564

Please sign in to comment.