From: Nikita Popov Date: Mon, 31 Aug 2020 10:38:11 +0000 (+0200) Subject: Fixed bug #80030 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=50975640bc2bd86f4aa1c1eb00bd9dc3a9764e72;p=php Fixed bug #80030 --- diff --git a/NEWS b/NEWS index ebb16c8988..804fa57a95 100644 --- a/NEWS +++ b/NEWS @@ -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: diff --git a/Zend/tests/bug80030.phpt b/Zend/tests/bug80030.phpt new file mode 100644 index 0000000000..cf5a668345 --- /dev/null +++ b/Zend/tests/bug80030.phpt @@ -0,0 +1,19 @@ +--TEST-- +Bug #80030: Optimizer segfault with isset on static property with undef dynamic class name +--FILE-- + +--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 diff --git a/ext/opcache/Optimizer/zend_optimizer.c b/ext/opcache/Optimizer/zend_optimizer.c index fcfaea0bc5..c71e7c040b 100644 --- a/ext/opcache/Optimizer/zend_optimizer.c +++ b/ext/opcache/Optimizer/zend_optimizer.c @@ -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: