Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix segfault with php 5.5 & auto_prepend_file #48

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 8 additions & 3 deletions extension/xhprof.c
Expand Up @@ -76,7 +76,7 @@
*/

/* XHProf version */
#define XHPROF_VERSION "0.9.2"
#define XHPROF_VERSION "0.9.5"

/* Fictitious function name to represent top of the call tree. The paranthesis
* in the name is to ensure we don't conflict with user function names. */
Expand Down Expand Up @@ -962,7 +962,11 @@ static char *hp_get_function_name(zend_op_array *ops TSRMLS_DC) {
* include, eval, etc.
*/
#if ZEND_EXTENSION_API_NO >= 220121212
curr_op = data->prev_execute_data->opline->extended_value;
if (data->prev_execute_data) {
curr_op = data->prev_execute_data->opline->extended_value;
} else {
curr_op = data->opline->extended_value;
}
#elif ZEND_EXTENSION_API_NO >= 220100525
curr_op = data->opline->extended_value;
#else
Expand Down Expand Up @@ -991,6 +995,7 @@ static char *hp_get_function_name(zend_op_array *ops TSRMLS_DC) {
break;
default:
func = "???_op";
add_filename = 1;
break;
}

Expand Down Expand Up @@ -2040,4 +2045,4 @@ static inline void hp_array_del(char **name_array) {
}
efree(name_array);
}
}
}