[xdebug-dev] Bug 0000323: Code coverage indicated incorrectly

From: <noreply[@]lists.xdebug.org>
Date: Sat, 27 Oct 2007 18:02:22 +0200

The following bug has been RESOLVED.
======================================================================
http://bugs.xdebug.org/bug_view_page.php?bug_id=0000323
======================================================================
Reporter: tobyS
Handler: derick
======================================================================
Project: Xdebug
Bug ID: 323
Category: Usage problems
Reproducibility: always
Severity: minor
Priority: normal
Status: resolved
Operating System: Gentoo (but manually compiled PHP stuff)
PHP Version: 5.2-dev
Xdebug Version: 2.1.0-dev
Resolution: not fixable
======================================================================
Date Submitted: 2007-10-23 20:51 CEST
Last Modified: 2007-10-27 18:02 CEST
======================================================================
Summary: Code coverage indicated incorrectly
Description:
As seen in the snip, all relevant lines are executed 154 times (correctly)
and some are unreachable (logically), but the closing brace of the ternary
is not recognized to be either and marked as not executed.

PHP version is actually 5.2.4.
======================================================================

----------------------------------------------------------------------
 derick - 2007-10-27 18:02 CEST
----------------------------------------------------------------------
There is not much that I can do about it, the line numbers that the engine
reports here totally make no sense. I simplified the code to:

  1 <?php
  2 function doSomething( $foo ) { echo $foo, "\n"; }
  3
  4 doSomething (
  5 ( false
  6 ? 42
  7 : 43
  8 )
  9 );
 10 ?>

The generated opcodes are:

line # op fetch ext return
operands
-------------------------------------------------------------------------------
   2 0 EXT_STMT
         1 NOP
   4 2 EXT_STMT
         3 EXT_FCALL_BEGIN
   6 4 JMPZ
false, ->7
   7 5 QM_ASSIGN ~0 42
         6 JMP ->8
   8 7 QM_ASSIGN ~0 43
   9 8 SEND_VAL ~0
         9 DO_FCALL 1
'dosomething'
        10 EXT_FCALL_END
  11 11 EXT_STMT
        12 RETURN 1
        13* ZEND_HANDLE_EXCEPTION

As you can see, the assignments (op 5 and 7) are done on the line *after*
the actual "assignment" (7 and 8 instead of 6 and 7).

Bug History
Date Modified Username Field Change
======================================================================
2007-10-23 20:51tobyS New Bug
2007-10-23 20:51tobyS Bug Monitored: tobyS
2007-10-27 18:02derick Bugnote Added: 0000765
2007-10-27 18:02derick Assigned To => derick
2007-10-27 18:02derick Resolution open => not fixable
2007-10-27 18:02derick Status new => resolved
======================================================================
Received on Sat Oct 27 2007 - 18:02:26 BST

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