summaryrefslogtreecommitdiff
path: root/Zend
diff options
context:
space:
mode:
Diffstat (limited to 'Zend')
-rw-r--r--Zend/zend_builtin_functions.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c
index 60afdac722..107d3d745a 100644
--- a/Zend/zend_builtin_functions.c
+++ b/Zend/zend_builtin_functions.c
@@ -1584,8 +1584,9 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last TSRML
/* skip debug_backtrace() */
ptr = ptr->prev_execute_data;
- if (skip_last) {
- cur_arg_pos -= 2;
+ if (skip_last--) {
+ int arg_count = *((ulong*)(cur_arg_pos - 2));
+ cur_arg_pos -= (arg_count + 2);
frames_on_stack--;
}