diff options
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | ext/opcache/Optimizer/block_pass.c | 4 | ||||
-rw-r--r-- | ext/opcache/tests/bug70237.phpt | 20 |
3 files changed, 28 insertions, 0 deletions
@@ -10,6 +10,10 @@ PHP NEWS . Fixed bug #66606 (Sets HTTP_CONTENT_TYPE but not CONTENT_TYPE). (wusuopu, cmb) +- Opcache: + . Fixed bug #70237 (Empty while and do-while segmentation fault with opcode + on CLI enabled). (Dmitry, Laruence) + - Standard: . Fixed bug #70052 (getimagesize() fails for very large and very small WBMP). (cmb) diff --git a/ext/opcache/Optimizer/block_pass.c b/ext/opcache/Optimizer/block_pass.c index 8d33105866..c146d0cc8c 100644 --- a/ext/opcache/Optimizer/block_pass.c +++ b/ext/opcache/Optimizer/block_pass.c @@ -367,6 +367,10 @@ static inline void del_source(zend_code_block *from, zend_code_block *to) return; } + if (from == to) { + return; + } + while (*cs) { if ((*cs)->from == from) { DEL_SOURCE(cs); diff --git a/ext/opcache/tests/bug70237.phpt b/ext/opcache/tests/bug70237.phpt new file mode 100644 index 0000000000..6bd0318f0b --- /dev/null +++ b/ext/opcache/tests/bug70237.phpt @@ -0,0 +1,20 @@ +--TEST-- +Bug #70237 (Empty while and do-while segmentation fault with opcode on CLI enabled) +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +--SKIPIF-- +<?php require_once('skipif.inc'); ?> +--FILE-- +<?php + + +function neverUsed() { + $bool = false; + while ($bool) { }; + //do { } while ($bool); +} +?> +okey +--EXPECT-- +okey |