From 041a01fd6cccb44bc38433aeffd958ce93b5a138 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Thu, 17 Mar 2016 20:20:01 +0800 Subject: [PATCH] Fixed for PHP7 --- NEWS | 4 ++++ ext/opcache/Optimizer/block_pass.c | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 4833396a37..419fbc499a 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,10 @@ PHP NEWS - Core: . Fixed bug #71841 (EG(error_zval) is not handled well). (Laruence) +- Opcache: + . Fixed bug #71843 (null ptr deref ZEND_RETURN_SPEC_CONST_HANDLER). + (Laruence) + - Standard: . Fixed bug #71840 (Unserialize accepts wrongly data). (Ryat, Laruence) diff --git a/ext/opcache/Optimizer/block_pass.c b/ext/opcache/Optimizer/block_pass.c index 1e85b0bdea..830addc38a 100644 --- a/ext/opcache/Optimizer/block_pass.c +++ b/ext/opcache/Optimizer/block_pass.c @@ -1894,8 +1894,11 @@ static void zend_t_usage(zend_code_block *block, zend_op_array *op_array, zend_b case ZEND_BOOL_NOT: if (ZEND_OP1_TYPE(opline) == IS_CONST) { literal_dtor(&ZEND_OP1_LITERAL(opline)); + } else if (ZEND_OP1_TYPE(opline) == IS_TMP_VAR) { + opline->opcode = ZEND_FREE; + } else { + MAKE_NOP(opline); } - MAKE_NOP(opline); break; case ZEND_JMPZ_EX: case ZEND_JMPNZ_EX: -- 2.40.0