From d8fe645db444e54fcc8b2555c08a5021c17ca2d3 Mon Sep 17 00:00:00 2001 From: Bob Weinand Date: Tue, 4 Aug 2015 00:00:10 +0200 Subject: Fix valgrind errors in phpdbg Revert "We cannot safely assume that all op array will be refcount 0 after execution" This reverts commit b6936adb58288a0606ed847802d9226cddb41e2b. This change turns out to not have been a clever idea and was causing more weirdness than it helped... --- Zend/zend_opcode.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'Zend/zend_opcode.c') diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index da401e17b9..347761e9a8 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -335,7 +335,7 @@ void zend_class_add_ref(zval *zv) ce->refcount++; } -ZEND_API zend_bool destroy_op_array(zend_op_array *op_array) +ZEND_API void destroy_op_array(zend_op_array *op_array) { zval *literal = op_array->literals; zval *end; @@ -353,12 +353,8 @@ ZEND_API zend_bool destroy_op_array(zend_op_array *op_array) op_array->run_time_cache = NULL; } - if (!op_array->refcount) { - return 1; - } - - if (--(*op_array->refcount) > 0) { - return 0; + if (!op_array->refcount || --(*op_array->refcount) > 0) { + return; } efree_size(op_array->refcount, sizeof(*(op_array->refcount))); @@ -419,8 +415,6 @@ ZEND_API zend_bool destroy_op_array(zend_op_array *op_array) } efree(arg_info); } - - return 1; } void init_op(zend_op *op) -- cgit v1.2.1