Permalink
Browse files

Fixed the segfault in bug #701.

This is not the end of the bug yet, as it should be fixed cleverder in a later
version.
  • Loading branch information...
1 parent 0e12ab5 commit 4ae8853aef01d113fcb11f88621311222fd5e869 @derickr committed Apr 3, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 xdebug_code_coverage.c
@@ -157,8 +157,12 @@ static char *xdebug_find_var_name(zend_execute_data *execute_data TSRMLS_DC)
xdebug_str_add(&name, xdebug_sprintf("%s", zval_value), 1);
}
if (opcode_ptr->opcode == ZEND_FETCH_DIM_W) {
- zval_value = xdebug_get_zval_value(xdebug_get_zval(execute_data, &opcode_ptr->op2, execute_data->Ts, &is_var), 0, NULL);
- xdebug_str_add(&name, xdebug_sprintf("[%s]", zval_value), 1);
+ if (opcode_ptr->op2.op_type != IS_VAR) {
+ zval_value = xdebug_get_zval_value(xdebug_get_zval(execute_data, &opcode_ptr->op2, execute_data->Ts, &is_var), 0, NULL);
+ xdebug_str_add(&name, xdebug_sprintf("[%s]", zval_value), 1);
+ } else {
+ xdebug_str_add(&name, xdebug_sprintf("[???]") , 1);
+ }
} else if (opcode_ptr->opcode == ZEND_FETCH_OBJ_W) {
zval_value = xdebug_get_zval_value(xdebug_get_zval(execute_data, &opcode_ptr->op2, execute_data->Ts, &is_var), 0, options);
xdebug_str_add(&name, xdebug_sprintf("->%s", zval_value), 1);

0 comments on commit 4ae8853

Please sign in to comment.