From: Bob Weinand Date: Wed, 22 Jul 2015 21:16:50 +0000 (+0200) Subject: Opcache is assuming that op_arrays without refcount are always efree()d X-Git-Tag: php-7.0.0beta3~5^2~103^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=531fa70ba843895270a795acebaebca143704abb;p=php Opcache is assuming that op_arrays without refcount are always efree()d We maybe should search for some other way, because just not refcounting the op_array is rather a dirty hack. If possible, we should change opcache and just expect op_array->refcount != NULL ... but I have not found a clean way yet. --- diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index b0242c800e..90afc6a985 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -352,7 +352,11 @@ ZEND_API zend_bool destroy_op_array(zend_op_array *op_array) efree(op_array->run_time_cache); } - if (!op_array->refcount || --(*op_array->refcount) > 0) { + if (!op_array->refcount) { + return 1; + } + + if (--(*op_array->refcount) > 0) { return 0; }