diff options
-rw-r--r-- | sapi/phpdbg/phpdbg_list.c | 7 | ||||
-rw-r--r-- | sapi/phpdbg/tests/phpdbg_oplog_001.phpt | 10 |
2 files changed, 10 insertions, 7 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; } diff --git a/sapi/phpdbg/tests/phpdbg_oplog_001.phpt b/sapi/phpdbg/tests/phpdbg_oplog_001.phpt index 868493b4ba..15eeea5ebe 100644 --- a/sapi/phpdbg/tests/phpdbg_oplog_001.phpt +++ b/sapi/phpdbg/tests/phpdbg_oplog_001.phpt @@ -9,9 +9,7 @@ q [Successful compilation of %s] prompt> halloarray(2) { ["%s"]=> - array(6) { - [11]=> - int(0) + array(5) { [13]=> int(1) [17]=> @@ -25,10 +23,10 @@ prompt> halloarray(2) { } ["A::b"]=> array(2) { - [5]=> - int(5) [4]=> int(1) + [5]=> + int(5) } } [Script ended normally] @@ -54,5 +52,5 @@ $a = new A(); $a->b(); $a->b('ha'); -var_dump(phpdbg_end_oplog(["functions" => true, "show_unexecuted" => true])); +var_dump(phpdbg_end_oplog(["functions" => true])); |