Skip to content

Commit

Permalink
Fixed issue #1373: Crash in zend_hash_apply_with_arguments when debug…
Browse files Browse the repository at this point in the history
…ging, due to unset symbol table
  • Loading branch information
derickr committed Dec 2, 2016
1 parent 000b56c commit 6df4727
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
14 changes: 12 additions & 2 deletions xdebug.c
Original file line number Diff line number Diff line change
Expand Up @@ -1842,7 +1842,13 @@ void xdebug_execute(zend_op_array *op_array TSRMLS_DC)
fse->execute_data = EG(current_execute_data);
#endif
#if PHP_VERSION_ID >= 70000
# if PHP_VERSION_ID >= 70100
if (ZEND_CALL_INFO(EG(current_execute_data)) & ZEND_CALL_HAS_SYMBOL_TABLE) {
fse->symbol_table = EG(current_execute_data)->symbol_table;
}
# else
fse->symbol_table = EG(current_execute_data)->symbol_table;
# endif
if (Z_OBJ(EG(current_execute_data)->This)) {
fse->This = &EG(current_execute_data)->This;
} else {
Expand Down Expand Up @@ -2316,7 +2322,9 @@ PHP_FUNCTION(xdebug_debug_zval)
WRONG_PARAM_COUNT;
}

#if PHP_VERSION_ID >= 70000
#if PHP_VERSION_ID >= 70100
if (!(ZEND_CALL_INFO(EG(current_execute_data)->prev_execute_data) & ZEND_CALL_HAS_SYMBOL_TABLE)) {
#elif PHP_VERSION_ID >= 70000
if (!EG(current_execute_data)->prev_execute_data->symbol_table) {
#else
if (!EG(active_symbol_table)) {
Expand Down Expand Up @@ -2388,7 +2396,9 @@ PHP_FUNCTION(xdebug_debug_zval_stdout)
WRONG_PARAM_COUNT;
}

#if PHP_VERSION_ID >= 70000
#if PHP_VERSION_ID >= 70100
if (!(ZEND_CALL_INFO(EG(current_execute_data)->prev_execute_data) & ZEND_CALL_HAS_SYMBOL_TABLE)) {
#elif PHP_VERSION_ID >= 70000
if (!EG(current_execute_data)->prev_execute_data->symbol_table) {
#else
if (!EG(active_symbol_table)) {
Expand Down
4 changes: 3 additions & 1 deletion xdebug_stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ static void dump_used_var_with_contents(void *htmlq, xdebug_hash_element* he, vo
return;
}

#if PHP_VERSION_ID >= 70000
#if PHP_VERSION_ID >= 70100
if (!(ZEND_CALL_INFO(EG(current_execute_data)) & ZEND_CALL_HAS_SYMBOL_TABLE)) {
#elif PHP_VERSION_ID >= 70000
if (!EG(current_execute_data)->symbol_table) {
#else
if (!EG(active_symbol_table)) {
Expand Down

0 comments on commit 6df4727

Please sign in to comment.