File xdebug-2.0.3-codecoverage.patch of Package php-pecl-xdebug
x
1
diff -u xdebug-2.0.3-orig/xdebug_code_coverage.c xdebug-2.0.3/xdebug_code_coverage.c
2
--- xdebug-2.0.3-orig/xdebug_code_coverage.c 2008-04-09 10:52:03.000000000 -0400
3
+++ xdebug-2.0.3/xdebug_code_coverage.c 2008-08-27 13:18:54.000000000 -0400
4
5
) {
6
*jmp1 = position + 1;
7
#ifdef ZEND_ENGINE_2
8
- *jmp2 = ((long) opcode.op2.u.jmp_addr - (long) base_address) / sizeof(zend_op);
9
+ /* if opline_num is smaller than base_address, use it directly */
10
+ if ((long) opcode.op2.u.opline_num < (long) base_address) {
11
+ *jmp2 = opcode.op2.u.opline_num;
12
+ } else {
13
+ *jmp2 = ((long) opcode.op2.u.jmp_addr - (long) base_address) / sizeof(zend_op);
14
+ }
15
#else
16
*jmp2 = opcode.op1.u.opline_num;
17
#endif
18
19
long jump_pos1 = -1;
20
long jump_pos2 = -1;
21
22
+ /* Cancel if position is bigger than the actual size */
23
+ if (position > opa->size) {
24
+ return;
25
+ }
26
+
27
/*(fprintf(stderr, "Branch analysis from position: %d\n", position);)*/
28
/* First we see if the branch has been visited, if so we bail out. */
29
if (xdebug_set_in(set, position)) {
30