]> granicus.if.org Git - php/commitdiff
Fixed bug #80030
authorNikita Popov <nikita.ppv@gmail.com>
Mon, 31 Aug 2020 10:38:11 +0000 (12:38 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 31 Aug 2020 10:38:11 +0000 (12:38 +0200)
NEWS
Zend/tests/bug80030.phpt [new file with mode: 0644]
ext/opcache/Optimizer/zend_optimizer.c

diff --git a/NEWS b/NEWS
index ebb16c89881abfb4be0d4b7107d641dd676fe8d9..804fa57a952474d6cb2f6c3438166bd695a0e4b5 100644 (file)
--- 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 (file)
index 0000000..cf5a668
--- /dev/null
@@ -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
index fcfaea0bc5d033a89e2cec44132235180c08da32..c71e7c040ba6a3b60d2f6e61999d9c87f285a2ff 100644 (file)
@@ -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: