]> granicus.if.org Git - php/commitdiff
Opcache is assuming that op_arrays without refcount are always efree()d
authorBob Weinand <bobwei9@hotmail.com>
Wed, 22 Jul 2015 21:16:50 +0000 (23:16 +0200)
committerBob Weinand <bobwei9@hotmail.com>
Wed, 22 Jul 2015 21:16:50 +0000 (23:16 +0200)
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.

Zend/zend_opcode.c

index b0242c800e1fdeccd37b8e88a12e44096adcfce3..90afc6a9851a4426fe1ebe22aafb6064111093e2 100644 (file)
@@ -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;
        }