Skip to content

Commit

Permalink
Fix 5.6 throwing errors due to invalid VM state
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelchcki committed Nov 13, 2018
1 parent cd320f4 commit ff65544
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 2 additions & 6 deletions src/ext/dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,6 @@ static void execute_fcall(ddtrace_dispatch_t *dispatch, zend_execute_data *execu
if (!return_value_ptr) {
zval_dtor(&rv);
}
#if PHP_VERSION_ID < 70000
zend_vm_stack_clear_multiple(0 TSRMLS_CC);
#endif
}

#if PHP_VERSION_ID < 70000
Expand Down Expand Up @@ -275,9 +272,8 @@ static zend_always_inline zend_bool get_wrappable_function(zend_execute_data *ex

static int update_opcode_leave(zend_execute_data *execute_data) {
#if PHP_VERSION_ID < 70000
if (EG(exception)) {
zend_vm_stack_pop(); // clear param data if FN has thrown an exception
}
zend_vm_stack_clear_multiple(0 TSRMLS_CC);
EX(call)--;
#else
EX(call) = EX(call)->prev_execute_data;
#endif
Expand Down
4 changes: 3 additions & 1 deletion src/ext/dispatch_compat_php5.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ static zend_always_inline void setup_fcal_name(zend_execute_data *execute_data,
if (EX(call)->num_additional_args) {
vm_stack_push_args(fci->param_count TSRMLS_CC);
} else {
EX(function_state).arguments = zend_vm_stack_top(TSRMLS_C);
if (fci->param_count) {
EX(function_state).arguments = zend_vm_stack_top(TSRMLS_C);
}
zend_vm_stack_push((void *)(zend_uintptr_t)fci->param_count TSRMLS_CC);
}

Expand Down

0 comments on commit ff65544

Please sign in to comment.