Skip to content

Commit

Permalink
Merged pull request #274
Browse files Browse the repository at this point in the history
  • Loading branch information
derickr committed May 14, 2016
2 parents 782fc5d + 87aa002 commit 7c4b448
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 2 deletions.
22 changes: 22 additions & 0 deletions tests/bug01263-php7.phpt
@@ -0,0 +1,22 @@
--TEST--
Test for bug #1210: Coverage of sending arguments to a method (>= PHP 7.0)
--SKIPIF--
<?php if (!version_compare(phpversion(), "7.0", '>=')) echo "skip >= PHP 7.0 needed\n"; ?>
--EXTENSIONS--
opcache
--INI--
opcache.enable_cli=1
--FILE--
<?php
include 'dump-branch-coverage.inc';

xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE);

include 'bug01263.inc';

xdebug_stop_code_coverage(false);

?>
==DONE==
--EXPECT--
==DONE==
21 changes: 21 additions & 0 deletions tests/bug01263.inc
@@ -0,0 +1,21 @@
<?php
/*
* This file is part of the PHP_CodeCoverage package.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

class PHP_CodeCoverage
{
private function addUncoveredFilesFromWhitelist()
{
foreach ($uncoveredFiles as $uncoveredFile) {
for ($i = 1; $i <= $lines; $i++) {
$data[$uncoveredFile][$i] = PHP_CodeCoverage_Driver::LINE_NOT_EXECUTED;
}
}
}
}
5 changes: 3 additions & 2 deletions xdebug_code_coverage.c
Expand Up @@ -595,11 +595,12 @@ static int xdebug_find_jump(zend_op_array *opa, unsigned int position, long *jmp
return 1;
} else if (opcode.opcode == ZEND_JMPZNZ) {
#if PHP_VERSION_ID >= 70000
*jmp1 = XDEBUG_ZNODE_JMP_LINE(opcode.op2, position, base_address) * sizeof(zend_op);
*jmp1 = XDEBUG_ZNODE_JMP_LINE(opcode.op2, position, base_address);
*jmp2 = (int32_t) (position + ((int32_t)opcode.extended_value / sizeof(zend_op)));
#else
*jmp1 = XDEBUG_ZNODE_ELEM(opcode.op2, opline_num);
#endif
*jmp2 = opcode.extended_value;
#endif
return 1;
#if PHP_VERSION_ID < 70000
} else if (opcode.opcode == ZEND_BRK || opcode.opcode == ZEND_CONT) {
Expand Down

0 comments on commit 7c4b448

Please sign in to comment.