summaryrefslogtreecommitdiff
path: root/sapi/phpdbg/phpdbg_list.c
diff options
context:
space:
mode:
authorBob Weinand <bobwei9@hotmail.com>2015-07-23 01:03:03 +0200
committerBob Weinand <bobwei9@hotmail.com>2015-07-23 01:03:03 +0200
commit686b9039a6d8ba820538222bbb44925ae25c4c93 (patch)
tree049c25627a8d27fbdb72b67ab7131a803e21ac12 /sapi/phpdbg/phpdbg_list.c
parent531fa70ba843895270a795acebaebca143704abb (diff)
downloadphp-git-686b9039a6d8ba820538222bbb44925ae25c4c93.tar.gz
Fix phpdbg test failure and crash with opcache
Diffstat (limited to 'sapi/phpdbg/phpdbg_list.c')
-rw-r--r--sapi/phpdbg/phpdbg_list.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sapi/phpdbg/phpdbg_list.c b/sapi/phpdbg/phpdbg_list.c
index a2f5ff6cc5..3a7761cc64 100644
--- a/sapi/phpdbg/phpdbg_list.c
+++ b/sapi/phpdbg/phpdbg_list.c
@@ -289,7 +289,12 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) {
zend_file_handle_dtor(&fake);
dataptr->op_array = ret;
- ++*dataptr->op_array->refcount;
+ if (dataptr->op_array->refcount) {
+ ++*dataptr->op_array->refcount;
+ } else {
+ dataptr->op_array->refcount = emalloc(sizeof(uint32_t));
+ *dataptr->op_array->refcount = 2;
+ }
return ret;
}