Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed bug #818: Require a php script in the PHP_RINIT causes Xdebug t…

…o crash.
  • Loading branch information...
commit acf8ae572573b3859807d60f6a41c9809f6a791a 1 parent dc90da1
@derickr authored
Showing with 17 additions and 14 deletions.
  1. +3 −1 xdebug.c
  2. +14 −13 xdebug_stack.c
View
4 xdebug.c
@@ -1473,7 +1473,9 @@ void xdebug_execute_ex(zend_execute_data *execute_data TSRMLS_DC)
fse->symbol_table = NULL;
fse->execute_data = NULL;
- xdebug_llist_remove(XG(stack), XDEBUG_LLIST_TAIL(XG(stack)), xdebug_stack_element_dtor);
+ if (XG(stack)) {
+ xdebug_llist_remove(XG(stack), XDEBUG_LLIST_TAIL(XG(stack)), xdebug_stack_element_dtor);
+ }
XG(level)--;
}
View
27 xdebug_stack.c
@@ -1005,6 +1005,7 @@ function_stack_entry *xdebug_add_stack_frame(zend_execute_data *zdata, zend_op_a
#endif
tmp->time = xdebug_get_utime();
tmp->lineno = 0;
+ tmp->prev = 0;
xdebug_build_fname(&(tmp->function), zdata TSRMLS_CC);
if (!tmp->function.type) {
@@ -1153,24 +1154,24 @@ function_stack_entry *xdebug_add_stack_frame(zend_execute_data *zdata, zend_op_a
}
}
- if (XDEBUG_LLIST_TAIL(XG(stack))) {
- function_stack_entry *prev = XDEBUG_LLIST_VALP(XDEBUG_LLIST_TAIL(XG(stack)));
- tmp->prev = prev;
- if (XG(profiler_aggregate)) {
- if (prev->aggr_entry->call_list) {
- if (!zend_hash_exists(prev->aggr_entry->call_list, aggr_key, aggr_key_len+1)) {
+ if (XG(stack)) {
+ if (XDEBUG_LLIST_TAIL(XG(stack))) {
+ function_stack_entry *prev = XDEBUG_LLIST_VALP(XDEBUG_LLIST_TAIL(XG(stack)));
+ tmp->prev = prev;
+ if (XG(profiler_aggregate)) {
+ if (prev->aggr_entry->call_list) {
+ if (!zend_hash_exists(prev->aggr_entry->call_list, aggr_key, aggr_key_len+1)) {
+ zend_hash_add(prev->aggr_entry->call_list, aggr_key, aggr_key_len+1, (void*)&tmp->aggr_entry, sizeof(xdebug_aggregate_entry*), NULL);
+ }
+ } else {
+ prev->aggr_entry->call_list = xdmalloc(sizeof(HashTable));
+ zend_hash_init_ex(prev->aggr_entry->call_list, 1, NULL, NULL, 1, 0);
zend_hash_add(prev->aggr_entry->call_list, aggr_key, aggr_key_len+1, (void*)&tmp->aggr_entry, sizeof(xdebug_aggregate_entry*), NULL);
}
- } else {
- prev->aggr_entry->call_list = xdmalloc(sizeof(HashTable));
- zend_hash_init_ex(prev->aggr_entry->call_list, 1, NULL, NULL, 1, 0);
- zend_hash_add(prev->aggr_entry->call_list, aggr_key, aggr_key_len+1, (void*)&tmp->aggr_entry, sizeof(xdebug_aggregate_entry*), NULL);
}
}
- } else {
- tmp->prev = 0;
+ xdebug_llist_insert_next(XG(stack), XDEBUG_LLIST_TAIL(XG(stack)), tmp);
}
- xdebug_llist_insert_next(XG(stack), XDEBUG_LLIST_TAIL(XG(stack)), tmp);
if (XG(profiler_aggregate)) {
xdfree(aggr_key);
Please sign in to comment.
Something went wrong with that request. Please try again.