com php-src: Fix phpdbg test failure and crash with opcache: sapi/phpdbg/phpdbg_list.c sapi/phpdbg/tests/phpdbg_oplo g_001.phpt
| From: | Bob Weinand | Date: | Wed, 22 Jul 2015 23:03:03 +0000 |
| Subject: | com php-src: Fix phpdbg test failure and crash with opcache: sapi/phpdbg/phpdbg_list.c sapi/phpdbg/tests/phpdbg_oplo g_001.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-88122@lists.php.net to get a copy of this message | ||
Commit: 686b9039a6d8ba820538222bbb44925ae25c4c93
Author: Bob Weinand <bobwei9@hotmail.com> Thu, 23 Jul 2015 01:03:03 +0200
Parents: 531fa70ba843895270a795acebaebca143704abb
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=686b9039a6d8ba820538222bbb44925ae25c4c93
Log:
Fix phpdbg test failure and crash with opcache
Changed paths:
M sapi/phpdbg/phpdbg_list.c
M sapi/phpdbg/tests/phpdbg_oplog_001.phpt
Diff:
diff --git a/sapi/phpdbg/phpdbg_list.c b/sapi/phpdbg/phpdbg_list.c
index a2f5ff6..3a7761c 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 868493b..15eeea5 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]));