summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Zend/zend_execute_API.c4
-rw-r--r--Zend/zend_generators.c2
-rw-r--r--Zend/zend_iterators.c2
-rw-r--r--Zend/zend_objects_API.h2
-rw-r--r--Zend/zend_types.h28
-rw-r--r--Zend/zend_vm_def.h20
-rw-r--r--Zend/zend_vm_execute.h72
-rw-r--r--ext/dom/xpath.c2
-rw-r--r--ext/intl/common/common_enum.cpp2
-rw-r--r--ext/reflection/php_reflection.c2
-rw-r--r--sapi/phpdbg/phpdbg_watch.c8
11 files changed, 84 insertions, 60 deletions
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 983bc5c1e3..7b9dbce3ca 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -843,8 +843,8 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
EG(scope) = func->common.scope;
call->symbol_table = fci->symbol_table;
if (UNEXPECTED(func->op_array.fn_flags & ZEND_ACC_CLOSURE)) {
- ZEND_ASSERT(GC_TYPE(func->op_array.prototype) == IS_OBJECT);
- GC_REFCOUNT(func->op_array.prototype)++;
+ ZEND_ASSERT(GC_TYPE((zend_object*)func->op_array.prototype) == IS_OBJECT);
+ GC_REFCOUNT((zend_object*)func->op_array.prototype)++;
ZEND_ADD_CALL_FLAG(call, ZEND_CALL_CLOSURE);
}
if (EXPECTED((func->op_array.fn_flags & ZEND_ACC_GENERATOR) == 0)) {
diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c
index 1399762702..9ca264b97e 100644
--- a/Zend/zend_generators.c
+++ b/Zend/zend_generators.c
@@ -469,7 +469,7 @@ void zend_generator_yield_from(zend_generator *generator, zend_generator *from)
generator->node.parent = from;
zend_generator_get_current(generator);
- --GC_REFCOUNT(from);
+ --GC_REFCOUNT(&from->std);
}
ZEND_API zend_generator *zend_generator_get_current(zend_generator *generator)
diff --git a/Zend/zend_iterators.c b/Zend/zend_iterators.c
index 8914f08121..f42ddf63b9 100644
--- a/Zend/zend_iterators.c
+++ b/Zend/zend_iterators.c
@@ -81,7 +81,7 @@ ZEND_API void zend_iterator_init(zend_object_iterator *iter)
ZEND_API void zend_iterator_dtor(zend_object_iterator *iter)
{
- if (--GC_REFCOUNT(iter) > 0) {
+ if (--GC_REFCOUNT(&iter->std) > 0) {
return;
}
diff --git a/Zend/zend_objects_API.h b/Zend/zend_objects_API.h
index 5bc7d774bc..4497181add 100644
--- a/Zend/zend_objects_API.h
+++ b/Zend/zend_objects_API.h
@@ -77,7 +77,7 @@ static zend_always_inline void zend_object_release(zend_object *obj)
if (--GC_REFCOUNT(obj) == 0) {
zend_objects_store_del(obj);
} else if (UNEXPECTED(!GC_INFO(obj))) {
- gc_possible_root(&obj->gc);
+ gc_possible_root((zend_refcounted*)obj);
}
}
diff --git a/Zend/zend_types.h b/Zend/zend_types.h
index d4353f7d4d..1bbf7963ad 100644
--- a/Zend/zend_types.h
+++ b/Zend/zend_types.h
@@ -140,7 +140,7 @@ struct _zval_struct {
} u2;
};
-struct _zend_refcounted {
+typedef struct _zend_refcounted_h {
uint32_t refcount; /* reference counter 32-bit */
union {
struct {
@@ -151,10 +151,14 @@ struct _zend_refcounted {
} v;
uint32_t type_info;
} u;
+} zend_refcounted_h;
+
+struct _zend_refcounted {
+ zend_refcounted_h gc;
};
struct _zend_string {
- zend_refcounted gc;
+ zend_refcounted_h gc;
zend_ulong h; /* hash value */
size_t len;
char val[1];
@@ -169,7 +173,7 @@ typedef struct _Bucket {
typedef struct _zend_array HashTable;
struct _zend_array {
- zend_refcounted gc;
+ zend_refcounted_h gc;
union {
struct {
ZEND_ENDIAN_LOHI_4(
@@ -270,7 +274,7 @@ typedef struct _HashTableIterator {
} HashTableIterator;
struct _zend_object {
- zend_refcounted gc;
+ zend_refcounted_h gc;
uint32_t handle; // TODO: may be removed ???
zend_class_entry *ce;
const zend_object_handlers *handlers;
@@ -279,19 +283,19 @@ struct _zend_object {
};
struct _zend_resource {
- zend_refcounted gc;
+ zend_refcounted_h gc;
int handle; // TODO: may be removed ???
int type;
void *ptr;
};
struct _zend_reference {
- zend_refcounted gc;
+ zend_refcounted_h gc;
zval val;
};
struct _zend_ast_ref {
- zend_refcounted gc;
+ zend_refcounted_h gc;
zend_ast *ast;
};
@@ -365,11 +369,11 @@ static zend_always_inline zend_uchar zval_get_type(const zval* pz) {
#define Z_TYPE_FLAGS_SHIFT 8
#define Z_CONST_FLAGS_SHIFT 16
-#define GC_REFCOUNT(p) ((zend_refcounted*)(p))->refcount
-#define GC_TYPE(p) ((zend_refcounted*)(p))->u.v.type
-#define GC_FLAGS(p) ((zend_refcounted*)(p))->u.v.flags
-#define GC_INFO(p) ((zend_refcounted*)(p))->u.v.gc_info
-#define GC_TYPE_INFO(p) ((zend_refcounted*)(p))->u.type_info
+#define GC_REFCOUNT(p) (p)->gc.refcount
+#define GC_TYPE(p) (p)->gc.u.v.type
+#define GC_FLAGS(p) (p)->gc.u.v.flags
+#define GC_INFO(p) (p)->gc.u.v.gc_info
+#define GC_TYPE_INFO(p) (p)->gc.u.type_info
#define Z_GC_TYPE(zval) GC_TYPE(Z_COUNTED(zval))
#define Z_GC_TYPE_P(zval_p) Z_GC_TYPE(*(zval_p))
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index c968fd2907..7260ecb787 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -3241,8 +3241,8 @@ ZEND_VM_C_LABEL(try_function_name):
Z_OBJ_HANDLER_P(function_name, get_closure)(function_name, &called_scope, &fbc, &object) == SUCCESS) {
if (fbc->common.fn_flags & ZEND_ACC_CLOSURE) {
/* Delay closure destruction until its invocation */
- ZEND_ASSERT(GC_TYPE(fbc->common.prototype) == IS_OBJECT);
- GC_REFCOUNT(fbc->common.prototype)++;
+ ZEND_ASSERT(GC_TYPE((zend_object*)fbc->common.prototype) == IS_OBJECT);
+ GC_REFCOUNT((zend_object*)fbc->common.prototype)++;
call_info |= ZEND_CALL_CLOSURE;
} else if (object) {
call_info |= ZEND_CALL_RELEASE_THIS;
@@ -3377,8 +3377,8 @@ ZEND_VM_HANDLER(118, ZEND_INIT_USER_CALL, CONST, CONST|TMPVAR|CV)
if (OP2_TYPE & (IS_VAR|IS_CV)) {
ZVAL_DEREF(function_name);
}
- ZEND_ASSERT(GC_TYPE(func->common.prototype) == IS_OBJECT);
- GC_REFCOUNT(func->common.prototype)++;
+ ZEND_ASSERT(GC_TYPE((zend_object*)func->common.prototype) == IS_OBJECT);
+ GC_REFCOUNT((zend_object*)func->common.prototype)++;
call_info |= ZEND_CALL_CLOSURE;
}
called_scope = fcc.called_scope;
@@ -6727,9 +6727,11 @@ ZEND_VM_HANDLER(152, ZEND_JMP_SET, CONST|TMP|VAR|CV, ANY)
} else if (OP1_TYPE == IS_CV) {
if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
} else if (OP1_TYPE == IS_VAR && ref) {
+ zend_reference *r = Z_REF_P(ref);
+
if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
- if (UNEXPECTED(--GC_REFCOUNT(ref) == 0)) {
- efree_size(ref, sizeof(zend_reference));
+ if (UNEXPECTED(--GC_REFCOUNT(r) == 0)) {
+ efree_size(r, sizeof(zend_reference));
}
}
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
@@ -6765,9 +6767,11 @@ ZEND_VM_HANDLER(169, ZEND_COALESCE, CONST|TMP|VAR|CV, ANY)
} else if (OP1_TYPE == IS_CV) {
if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
} else if (OP1_TYPE == IS_VAR && ref) {
+ zend_reference *r = Z_REF_P(ref);
+
if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
- if (UNEXPECTED(--GC_REFCOUNT(ref) == 0)) {
- efree_size(ref, sizeof(zend_reference));
+ if (UNEXPECTED(--GC_REFCOUNT(r) == 0)) {
+ efree_size(r, sizeof(zend_reference));
}
}
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index 5645ed625a..e5915e49dd 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -2016,8 +2016,8 @@ try_function_name:
Z_OBJ_HANDLER_P(function_name, get_closure)(function_name, &called_scope, &fbc, &object) == SUCCESS) {
if (fbc->common.fn_flags & ZEND_ACC_CLOSURE) {
/* Delay closure destruction until its invocation */
- ZEND_ASSERT(GC_TYPE(fbc->common.prototype) == IS_OBJECT);
- GC_REFCOUNT(fbc->common.prototype)++;
+ ZEND_ASSERT(GC_TYPE((zend_object*)fbc->common.prototype) == IS_OBJECT);
+ GC_REFCOUNT((zend_object*)fbc->common.prototype)++;
call_info |= ZEND_CALL_CLOSURE;
} else if (object) {
call_info |= ZEND_CALL_RELEASE_THIS;
@@ -2438,8 +2438,8 @@ try_function_name:
Z_OBJ_HANDLER_P(function_name, get_closure)(function_name, &called_scope, &fbc, &object) == SUCCESS) {
if (fbc->common.fn_flags & ZEND_ACC_CLOSURE) {
/* Delay closure destruction until its invocation */
- ZEND_ASSERT(GC_TYPE(fbc->common.prototype) == IS_OBJECT);
- GC_REFCOUNT(fbc->common.prototype)++;
+ ZEND_ASSERT(GC_TYPE((zend_object*)fbc->common.prototype) == IS_OBJECT);
+ GC_REFCOUNT((zend_object*)fbc->common.prototype)++;
call_info |= ZEND_CALL_CLOSURE;
} else if (object) {
call_info |= ZEND_CALL_RELEASE_THIS;
@@ -2693,8 +2693,8 @@ try_function_name:
Z_OBJ_HANDLER_P(function_name, get_closure)(function_name, &called_scope, &fbc, &object) == SUCCESS) {
if (fbc->common.fn_flags & ZEND_ACC_CLOSURE) {
/* Delay closure destruction until its invocation */
- ZEND_ASSERT(GC_TYPE(fbc->common.prototype) == IS_OBJECT);
- GC_REFCOUNT(fbc->common.prototype)++;
+ ZEND_ASSERT(GC_TYPE((zend_object*)fbc->common.prototype) == IS_OBJECT);
+ GC_REFCOUNT((zend_object*)fbc->common.prototype)++;
call_info |= ZEND_CALL_CLOSURE;
} else if (object) {
call_info |= ZEND_CALL_RELEASE_THIS;
@@ -4011,9 +4011,11 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMP_SET_SPEC_CONST_HANDLER(ZEN
} else if (IS_CONST == IS_CV) {
if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
} else if (IS_CONST == IS_VAR && ref) {
+ zend_reference *r = Z_REF_P(ref);
+
if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
- if (UNEXPECTED(--GC_REFCOUNT(ref) == 0)) {
- efree_size(ref, sizeof(zend_reference));
+ if (UNEXPECTED(--GC_REFCOUNT(r) == 0)) {
+ efree_size(r, sizeof(zend_reference));
}
}
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
@@ -4048,9 +4050,11 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COALESCE_SPEC_CONST_HANDLER(ZE
} else if (IS_CONST == IS_CV) {
if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
} else if (IS_CONST == IS_VAR && ref) {
+ zend_reference *r = Z_REF_P(ref);
+
if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
- if (UNEXPECTED(--GC_REFCOUNT(ref) == 0)) {
- efree_size(ref, sizeof(zend_reference));
+ if (UNEXPECTED(--GC_REFCOUNT(r) == 0)) {
+ efree_size(r, sizeof(zend_reference));
}
}
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
@@ -5735,8 +5739,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CONS
if (IS_CONST & (IS_VAR|IS_CV)) {
ZVAL_DEREF(function_name);
}
- ZEND_ASSERT(GC_TYPE(func->common.prototype) == IS_OBJECT);
- GC_REFCOUNT(func->common.prototype)++;
+ ZEND_ASSERT(GC_TYPE((zend_object*)func->common.prototype) == IS_OBJECT);
+ GC_REFCOUNT((zend_object*)func->common.prototype)++;
call_info |= ZEND_CALL_CLOSURE;
}
called_scope = fcc.called_scope;
@@ -9485,8 +9489,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CV_H
if (IS_CV & (IS_VAR|IS_CV)) {
ZVAL_DEREF(function_name);
}
- ZEND_ASSERT(GC_TYPE(func->common.prototype) == IS_OBJECT);
- GC_REFCOUNT(func->common.prototype)++;
+ ZEND_ASSERT(GC_TYPE((zend_object*)func->common.prototype) == IS_OBJECT);
+ GC_REFCOUNT((zend_object*)func->common.prototype)++;
call_info |= ZEND_CALL_CLOSURE;
}
called_scope = fcc.called_scope;
@@ -11295,8 +11299,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_TMPV
if ((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) {
ZVAL_DEREF(function_name);
}
- ZEND_ASSERT(GC_TYPE(func->common.prototype) == IS_OBJECT);
- GC_REFCOUNT(func->common.prototype)++;
+ ZEND_ASSERT(GC_TYPE((zend_object*)func->common.prototype) == IS_OBJECT);
+ GC_REFCOUNT((zend_object*)func->common.prototype)++;
call_info |= ZEND_CALL_CLOSURE;
}
called_scope = fcc.called_scope;
@@ -12371,9 +12375,11 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMP_SET_SPEC_TMP_HANDLER(ZEND_
} else if (IS_TMP_VAR == IS_CV) {
if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
} else if (IS_TMP_VAR == IS_VAR && ref) {
+ zend_reference *r = Z_REF_P(ref);
+
if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
- if (UNEXPECTED(--GC_REFCOUNT(ref) == 0)) {
- efree_size(ref, sizeof(zend_reference));
+ if (UNEXPECTED(--GC_REFCOUNT(r) == 0)) {
+ efree_size(r, sizeof(zend_reference));
}
}
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
@@ -12409,9 +12415,11 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COALESCE_SPEC_TMP_HANDLER(ZEND
} else if (IS_TMP_VAR == IS_CV) {
if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
} else if (IS_TMP_VAR == IS_VAR && ref) {
+ zend_reference *r = Z_REF_P(ref);
+
if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
- if (UNEXPECTED(--GC_REFCOUNT(ref) == 0)) {
- efree_size(ref, sizeof(zend_reference));
+ if (UNEXPECTED(--GC_REFCOUNT(r) == 0)) {
+ efree_size(r, sizeof(zend_reference));
}
}
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
@@ -16203,9 +16211,11 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMP_SET_SPEC_VAR_HANDLER(ZEND_
} else if (IS_VAR == IS_CV) {
if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
} else if (IS_VAR == IS_VAR && ref) {
+ zend_reference *r = Z_REF_P(ref);
+
if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
- if (UNEXPECTED(--GC_REFCOUNT(ref) == 0)) {
- efree_size(ref, sizeof(zend_reference));
+ if (UNEXPECTED(--GC_REFCOUNT(r) == 0)) {
+ efree_size(r, sizeof(zend_reference));
}
}
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
@@ -16241,9 +16251,11 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COALESCE_SPEC_VAR_HANDLER(ZEND
} else if (IS_VAR == IS_CV) {
if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
} else if (IS_VAR == IS_VAR && ref) {
+ zend_reference *r = Z_REF_P(ref);
+
if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
- if (UNEXPECTED(--GC_REFCOUNT(ref) == 0)) {
- efree_size(ref, sizeof(zend_reference));
+ if (UNEXPECTED(--GC_REFCOUNT(r) == 0)) {
+ efree_size(r, sizeof(zend_reference));
}
}
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
@@ -29412,9 +29424,11 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMP_SET_SPEC_CV_HANDLER(ZEND_O
} else if (IS_CV == IS_CV) {
if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
} else if (IS_CV == IS_VAR && ref) {
+ zend_reference *r = Z_REF_P(ref);
+
if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
- if (UNEXPECTED(--GC_REFCOUNT(ref) == 0)) {
- efree_size(ref, sizeof(zend_reference));
+ if (UNEXPECTED(--GC_REFCOUNT(r) == 0)) {
+ efree_size(r, sizeof(zend_reference));
}
}
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
@@ -29449,9 +29463,11 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COALESCE_SPEC_CV_HANDLER(ZEND_
} else if (IS_CV == IS_CV) {
if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
} else if (IS_CV == IS_VAR && ref) {
+ zend_reference *r = Z_REF_P(ref);
+
if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
- if (UNEXPECTED(--GC_REFCOUNT(ref) == 0)) {
- efree_size(ref, sizeof(zend_reference));
+ if (UNEXPECTED(--GC_REFCOUNT(r) == 0)) {
+ efree_size(r, sizeof(zend_reference));
}
}
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
diff --git a/ext/dom/xpath.c b/ext/dom/xpath.c
index 6e7d7519c7..5dff89e37f 100644
--- a/ext/dom/xpath.c
+++ b/ext/dom/xpath.c
@@ -209,7 +209,7 @@ static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs,
ALLOC_HASHTABLE(intern->node_list);
zend_hash_init(intern->node_list, 0, NULL, ZVAL_PTR_DTOR, 0);
}
- GC_REFCOUNT(&retval)++;
+ Z_ADDREF(retval);
zend_hash_next_index_insert(intern->node_list, &retval);
obj = Z_DOMOBJ_P(&retval);
nodep = dom_object_get_node(obj);
diff --git a/ext/intl/common/common_enum.cpp b/ext/intl/common/common_enum.cpp
index e76f3b830f..0531a6b933 100644
--- a/ext/intl/common/common_enum.cpp
+++ b/ext/intl/common/common_enum.cpp
@@ -183,7 +183,7 @@ static zend_object_iterator *IntlIterator_get_iterator(
return NULL;
}
- ++GC_REFCOUNT(ii->iterator);
+ ++GC_REFCOUNT(&ii->iterator->std);
return ii->iterator;
}
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 463cbd6a3a..00731c70c3 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -2314,7 +2314,7 @@ ZEND_METHOD(reflection_generator, getExecutingGenerator)
REFLECTION_CHECK_VALID_GENERATOR(ex)
current = zend_generator_get_current(generator);
- ++GC_REFCOUNT(current);
+ ++GC_REFCOUNT(&current->std);
ZVAL_OBJ(return_value, (zend_object *) current);
}
diff --git a/sapi/phpdbg/phpdbg_watch.c b/sapi/phpdbg/phpdbg_watch.c
index 8c36d51223..06a0bbefe8 100644
--- a/sapi/phpdbg/phpdbg_watch.c
+++ b/sapi/phpdbg/phpdbg_watch.c
@@ -185,7 +185,7 @@ static phpdbg_watchpoint_t *phpdbg_create_refcounted_watchpoint(phpdbg_watchpoin
watch->parent = parent;
watch->str = parent->str;
++GC_REFCOUNT(parent->str);
- phpdbg_create_addr_watchpoint(&ref->refcount, sizeof(uint32_t), watch);
+ phpdbg_create_addr_watchpoint(&GC_REFCOUNT(ref), sizeof(uint32_t), watch);
watch->type = WATCH_ON_REFCOUNTED;
return watch;
@@ -1047,7 +1047,7 @@ static void phpdbg_print_changed_zval(phpdbg_watch_memdump *dump) {
}
if (Z_REFCOUNTED_P(watch->addr.zv)) {
if ((watch->flags & PHPDBG_WATCH_NORMAL) && (PHPDBG_G(flags) & PHPDBG_SHOW_REFCOUNTS)) {
- phpdbg_writeln("watchrefcount", "type=\"new\" refcount=\"%d\"", "New refcount: %d", Z_COUNTED_P(watch->addr.zv)->refcount);
+ phpdbg_writeln("watchrefcount", "type=\"new\" refcount=\"%d\"", "New refcount: %d", Z_REFCOUNT_P(watch->addr.zv));
}
if (watch->flags & PHPDBG_WATCH_RECURSIVE) {
phpdbg_create_recursive_watchpoint(watch);
@@ -1079,8 +1079,8 @@ static void phpdbg_print_changed_zval(phpdbg_watch_memdump *dump) {
break;
case WATCH_ON_REFCOUNTED: {
if ((watch->flags & PHPDBG_WATCH_NORMAL) && (PHPDBG_G(flags) & PHPDBG_SHOW_REFCOUNTS)) {
- phpdbg_writeln("watchrefcount", "type=\"old\" refcount=\"%d\"", "Old refcount: %d", ((zend_refcounted *) oldPtr)->refcount);
- phpdbg_writeln("watchrefcount", "type=\"new\" refcount=\"%d\"", "New refcount: %d", watch->addr.ref->refcount);
+ phpdbg_writeln("watchrefcount", "type=\"old\" refcount=\"%d\"", "Old refcount: %d", GC_REFCOUNT((zend_refcounted *) oldPtr));
+ phpdbg_writeln("watchrefcount", "type=\"new\" refcount=\"%d\"", "New refcount: %d", GC_REFCOUNT(watch->addr.ref));
}
break;
}