From a2564e2baccf6922c131f63b1dfe9e6ef912e813 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Mon, 13 Jan 2014 16:03:08 +0800 Subject: [PATCH] Fixed bug segfault due to EX(opline) might be NULL --- extension/xhprof.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/extension/xhprof.c b/extension/xhprof.c index a053ede8..b3d849da 100644 --- a/extension/xhprof.c +++ b/extension/xhprof.c @@ -1702,6 +1702,9 @@ ZEND_DLEXPORT void hp_execute_internal(zend_execute_data *execute_data, } if (!_zend_execute_internal) { +#if PHP_VERSION_ID >= 50500 + if (fci == NULL) { +#endif /* no old override to begin with. so invoke the builtin's implementation */ zend_op *opline = EX(opline); #if ZEND_EXTENSION_API_NO >= 220100525 @@ -1719,6 +1722,15 @@ ZEND_DLEXPORT void hp_execute_internal(zend_execute_data *execute_data, EX(function_state).function->common.return_reference ? &EX_T(opline->result.u.var).var.ptr:NULL, EX(object), ret TSRMLS_CC); +#endif +#if PHP_VERSION_ID >= 50500 + } else { + ((zend_internal_function *) EX(function_state).function)->handler( + fci->param_count, + *fci->retval_ptr_ptr, + fci->retval_ptr_ptr, + fci->object_ptr, ret TSRMLS_CC); + } #endif } else { /* call the old override */