blob: c0d73fbab0b83533ccef735d5361bd15a2b8d798 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
From ac8557ff69d2961e91a9212a81ef5eb535beda5f Mon Sep 17 00:00:00 2001
From: Derick Rethans <github@derickrethans.nl>
Date: Sun, 8 Nov 2015 20:35:36 -0500
Subject: [PATCH] Fixed issue #1195: Segfault with code coverage and foreach
---
tests/bug01195-php5.phpt | 37 +++++++++++++++++++++++++++++++++++++
tests/bug01195-php7.phpt | 38 ++++++++++++++++++++++++++++++++++++++
tests/bug01195.inc | 12 ++++++++++++
xdebug_code_coverage.c | 2 +-
4 files changed, 88 insertions(+), 1 deletion(-)
create mode 100644 tests/bug01195-php5.phpt
create mode 100644 tests/bug01195-php7.phpt
create mode 100644 tests/bug01195.inc
diff --git a/xdebug_code_coverage.c b/xdebug_code_coverage.c
index 6c52f81..85a9752 100644
--- a/xdebug_code_coverage.c
+++ b/xdebug_code_coverage.c
@@ -615,7 +615,7 @@ static int xdebug_find_jump(zend_op_array *opa, unsigned int position, long *jmp
#endif
*jmp1 = position + 1;
#if PHP_VERSION_ID >= 70000
- *jmp2 = XDEBUG_ZNODE_JMP_LINE(opcode.op2, position, base_address) * sizeof(zend_op);
+ *jmp2 = XDEBUG_ZNODE_JMP_LINE(opcode.op2, position, base_address);
#else
*jmp2 = XDEBUG_ZNODE_ELEM(opcode.op2, opline_num);
#endif
|