Browse Source

fixed #45, more robust xc_coverager_get_op_array_size_no_tail

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@228 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
1.2
Xuefer 15 years ago
parent
commit
dbca5f07b0
  1. 25
      coverager.c

25
coverager.c

@ -395,20 +395,21 @@ static int xc_coverager_get_op_array_size_no_tail(zend_op_array *op_array) /* {{
zend_uint size;
size = op_array->size;
#ifdef ZEND_ENGINE_2
if (op_array->opcodes[size - 1].opcode == ZEND_HANDLE_EXCEPTION) {
size --;
do {
next_op:
if (size == 0) {
break;
}
switch (op_array->opcodes[size - 1].opcode) {
#ifdef ZEND_HANDLE_EXCEPTION
case ZEND_HANDLE_EXCEPTION:
#endif
if (op_array->opcodes[size - 1].opcode == ZEND_RETURN) {
size --;
/* it's not real php statement */
if (op_array->opcodes[size - 1].opcode == ZEND_EXT_STMT) {
case ZEND_RETURN:
case ZEND_EXT_STMT:
size --;
}
}
#ifdef ZEND_ENGINE_2
}
#endif
goto next_op;
}
} while (0);
return size;
}
/* }}} */

Loading…
Cancel
Save