[xdebug-dev] svn: /xdebug/ branches/xdebug_2_1/tests/bug00651.phpt branches/xdebug_2_1/tests/bug00651b.phpt branches/xdebug_2_1/tests/bug00651c.phpt branches/xdebug_2_1/xdebug.c trunk/tests/bug00651.phpt trunk/tests/bug00651b.phpt trunk/tests/bug00651c.phpt trunk/xdebug.c

From: Derick Rethans <derick[@]derickrethans.nl>
Date: Mon, 10 Jan 2011 21:08:31 +0000

derick Mon, 10 Jan 2011 21:08:31 +0000

Revision: http://svn.xdebug.org/cgi-bin/viewvc.cgi?view=rev&revision=3388&root=xdebug

Log:
- One more opcode for bug #651: Incorrect code coverage after empty() in
  conditional when using XDEBUG_CC_UNUSED.

Changed paths:
    U xdebug/branches/xdebug_2_1/tests/bug00651.phpt
    A + xdebug/branches/xdebug_2_1/tests/bug00651b.phpt
        (from xdebug/branches/xdebug_2_1/tests/bug00651.phpt:r3387)
    A + xdebug/branches/xdebug_2_1/tests/bug00651c.phpt
        (from xdebug/branches/xdebug_2_1/tests/bug00651.phpt:r3387)
    U xdebug/branches/xdebug_2_1/xdebug.c
    U xdebug/trunk/tests/bug00651.phpt
    A + xdebug/trunk/tests/bug00651b.phpt
        (from xdebug/branches/xdebug_2_1/tests/bug00651.phpt:r3387)
    A + xdebug/trunk/tests/bug00651c.phpt
        (from xdebug/branches/xdebug_2_1/tests/bug00651.phpt:r3387)
    U xdebug/trunk/xdebug.c

Modified: xdebug/branches/xdebug_2_1/tests/bug00651.phpt
===================================================================
--- xdebug/branches/xdebug_2_1/tests/bug00651.phpt 2011-01-07 23:52:14 UTC (rev 3387)
+++ xdebug/branches/xdebug_2_1/tests/bug00651.phpt 2011-01-10 21:08:31 UTC (rev 3388)
@@ -1,5 +1,5 @@
 --TEST--
-Test for bug #651: Incorrect code coverage after empty() in conditional
+Test for bug #651: Incorrect code coverage after ! empty() in conditional
 --FILE--
 <?php


Copied: xdebug/branches/xdebug_2_1/tests/bug00651b.phpt (from rev 3387, xdebug/branches/xdebug_2_1/tests/bug00651.phpt)
===================================================================
--- xdebug/branches/xdebug_2_1/tests/bug00651b.phpt (rev 0)
+++ xdebug/branches/xdebug_2_1/tests/bug00651b.phpt 2011-01-10 21:08:31 UTC (rev 3388)
@@ -0,0 +1,62 @@
+--TEST--
+Test for bug #651: Incorrect code coverage after empty() in conditional
+--FILE--
+<?php
+
+xdebug_start_code_coverage(XDEBUG_CC_UNUSED);
+
+function repeat($x)
+{
+ if ( empty($x)
+ AND $x !== 1
+ AND $x !== 2
+ AND $x !== 3)
+ {
+ $y = 'covered';
+ }
+}
+
+repeat(0);
+repeat(1);
+repeat(2);
+repeat(3);
+repeat(4);
+
+var_dump(xdebug_get_code_coverage());
+?>
+--EXPECTF--
+array(1) {
+ ["%sbug00651b.php"]=>
+ array(15) {
+ [5]=>
+ int(1)
+ [7]=>
+ int(1)
+ [8]=>
+ int(1)
+ [9]=>
+ int(1)
+ [10]=>
+ int(1)
+ [11]=>
+ int(1)
+ [12]=>
+ int(1)
+ [13]=>
+ int(1)
+ [14]=>
+ int(1)
+ [16]=>
+ int(1)
+ [17]=>
+ int(1)
+ [18]=>
+ int(1)
+ [19]=>
+ int(1)
+ [20]=>
+ int(1)
+ [22]=>
+ int(1)
+ }
+}

Copied: xdebug/branches/xdebug_2_1/tests/bug00651c.phpt (from rev 3387, xdebug/branches/xdebug_2_1/tests/bug00651.phpt)
===================================================================
--- xdebug/branches/xdebug_2_1/tests/bug00651c.phpt (rev 0)
+++ xdebug/branches/xdebug_2_1/tests/bug00651c.phpt 2011-01-10 21:08:31 UTC (rev 3388)
@@ -0,0 +1,62 @@
+--TEST--
+Test for bug #651: Incorrect code coverage after isset() in conditional
+--FILE--
+<?php
+
+xdebug_start_code_coverage(XDEBUG_CC_UNUSED);
+
+function repeat($x)
+{
+ if ( isset($x)
+ AND $x !== 1
+ AND $x !== 2
+ AND $x !== 3)
+ {
+ $y = 'covered';
+ }
+}
+
+repeat(0);
+repeat(1);
+repeat(2);
+repeat(3);
+repeat(4);
+
+var_dump(xdebug_get_code_coverage());
+?>
+--EXPECTF--
+array(1) {
+ ["%sbug00651c.php"]=>
+ array(15) {
+ [5]=>
+ int(1)
+ [7]=>
+ int(1)
+ [8]=>
+ int(1)
+ [9]=>
+ int(1)
+ [10]=>
+ int(1)
+ [11]=>
+ int(1)
+ [12]=>
+ int(1)
+ [13]=>
+ int(1)
+ [14]=>
+ int(1)
+ [16]=>
+ int(1)
+ [17]=>
+ int(1)
+ [18]=>
+ int(1)
+ [19]=>
+ int(1)
+ [20]=>
+ int(1)
+ [22]=>
+ int(1)
+ }
+}

Modified: xdebug/branches/xdebug_2_1/xdebug.c
===================================================================
--- xdebug/branches/xdebug_2_1/xdebug.c 2011-01-07 23:52:14 UTC (rev 3387)
+++ xdebug/branches/xdebug_2_1/xdebug.c 2011-01-10 21:08:31 UTC (rev 3388)
@@ -512,6 +512,7 @@
         XDEBUG_SET_OPCODE_OVERRIDE_COMMON(ZEND_JMP);
         XDEBUG_SET_OPCODE_OVERRIDE_COMMON(ZEND_JMPZ);
         XDEBUG_SET_OPCODE_OVERRIDE_COMMON(ZEND_JMPNZ);
+ XDEBUG_SET_OPCODE_OVERRIDE_COMMON(ZEND_JMPZ_EX);
         XDEBUG_SET_OPCODE_OVERRIDE_COMMON(ZEND_IS_IDENTICAL);
         XDEBUG_SET_OPCODE_OVERRIDE_COMMON(ZEND_IS_NOT_IDENTICAL);
         XDEBUG_SET_OPCODE_OVERRIDE_COMMON(ZEND_IS_EQUAL);

Modified: xdebug/trunk/tests/bug00651.phpt
===================================================================
--- xdebug/trunk/tests/bug00651.phpt 2011-01-07 23:52:14 UTC (rev 3387)
+++ xdebug/trunk/tests/bug00651.phpt 2011-01-10 21:08:31 UTC (rev 3388)
@@ -1,5 +1,5 @@
 --TEST--
-Test for bug #651: Incorrect code coverage after empty() in conditional
+Test for bug #651: Incorrect code coverage after ! empty() in conditional
 --FILE--
 <?php


Copied: xdebug/trunk/tests/bug00651b.phpt (from rev 3387, xdebug/branches/xdebug_2_1/tests/bug00651.phpt)
===================================================================
--- xdebug/trunk/tests/bug00651b.phpt (rev 0)
+++ xdebug/trunk/tests/bug00651b.phpt 2011-01-10 21:08:31 UTC (rev 3388)
@@ -0,0 +1,62 @@
+--TEST--
+Test for bug #651: Incorrect code coverage after empty() in conditional
+--FILE--
+<?php
+
+xdebug_start_code_coverage(XDEBUG_CC_UNUSED);
+
+function repeat($x)
+{
+ if ( empty($x)
+ AND $x !== 1
+ AND $x !== 2
+ AND $x !== 3)
+ {
+ $y = 'covered';
+ }
+}
+
+repeat(0);
+repeat(1);
+repeat(2);
+repeat(3);
+repeat(4);
+
+var_dump(xdebug_get_code_coverage());
+?>
+--EXPECTF--
+array(1) {
+ ["%sbug00651b.php"]=>
+ array(15) {
+ [5]=>
+ int(1)
+ [7]=>
+ int(1)
+ [8]=>
+ int(1)
+ [9]=>
+ int(1)
+ [10]=>
+ int(1)
+ [11]=>
+ int(1)
+ [12]=>
+ int(1)
+ [13]=>
+ int(1)
+ [14]=>
+ int(1)
+ [16]=>
+ int(1)
+ [17]=>
+ int(1)
+ [18]=>
+ int(1)
+ [19]=>
+ int(1)
+ [20]=>
+ int(1)
+ [22]=>
+ int(1)
+ }
+}

Copied: xdebug/trunk/tests/bug00651c.phpt (from rev 3387, xdebug/branches/xdebug_2_1/tests/bug00651.phpt)
===================================================================
--- xdebug/trunk/tests/bug00651c.phpt (rev 0)
+++ xdebug/trunk/tests/bug00651c.phpt 2011-01-10 21:08:31 UTC (rev 3388)
@@ -0,0 +1,62 @@
+--TEST--
+Test for bug #651: Incorrect code coverage after isset() in conditional
+--FILE--
+<?php
+
+xdebug_start_code_coverage(XDEBUG_CC_UNUSED);
+
+function repeat($x)
+{
+ if ( isset($x)
+ AND $x !== 1
+ AND $x !== 2
+ AND $x !== 3)
+ {
+ $y = 'covered';
+ }
+}
+
+repeat(0);
+repeat(1);
+repeat(2);
+repeat(3);
+repeat(4);
+
+var_dump(xdebug_get_code_coverage());
+?>
+--EXPECTF--
+array(1) {
+ ["%sbug00651c.php"]=>
+ array(15) {
+ [5]=>
+ int(1)
+ [7]=>
+ int(1)
+ [8]=>
+ int(1)
+ [9]=>
+ int(1)
+ [10]=>
+ int(1)
+ [11]=>
+ int(1)
+ [12]=>
+ int(1)
+ [13]=>
+ int(1)
+ [14]=>
+ int(1)
+ [16]=>
+ int(1)
+ [17]=>
+ int(1)
+ [18]=>
+ int(1)
+ [19]=>
+ int(1)
+ [20]=>
+ int(1)
+ [22]=>
+ int(1)
+ }
+}

Modified: xdebug/trunk/xdebug.c
===================================================================
--- xdebug/trunk/xdebug.c 2011-01-07 23:52:14 UTC (rev 3387)
+++ xdebug/trunk/xdebug.c 2011-01-10 21:08:31 UTC (rev 3388)
@@ -540,6 +540,7 @@
         if (XG(coverage_enable)) {
                 XDEBUG_SET_OPCODE_OVERRIDE_COMMON(ZEND_JMP);
                 XDEBUG_SET_OPCODE_OVERRIDE_COMMON(ZEND_JMPZ);
+ XDEBUG_SET_OPCODE_OVERRIDE_COMMON(ZEND_JMPZ_EX);
                 XDEBUG_SET_OPCODE_OVERRIDE_COMMON(ZEND_JMPNZ);
                 XDEBUG_SET_OPCODE_OVERRIDE_COMMON(ZEND_IS_IDENTICAL);
                 XDEBUG_SET_OPCODE_OVERRIDE_COMMON(ZEND_IS_NOT_IDENTICAL);
Received on Mon Jan 10 2011 - 21:08:31 GMT

This archive was generated by hypermail 2.2.0 : Sun Jun 24 2018 - 04:00:03 BST