Permalink
Browse files

Fix crash when calling function with default paramter in RECV

  • Loading branch information...
1 parent eaacdff commit 4171c97e3da56412c220604a740c2f1c7816f71c @adoy committed Mar 31, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 Zend/zend_vm_def.h
View
@@ -3179,7 +3179,12 @@ ZEND_VM_HANDLER(63, ZEND_RECV, ANY, ANY)
zval **param = zend_vm_stack_get_arg(arg_num TSRMLS_CC);
SAVE_OPLINE();
- if (UNEXPECTED(param == NULL)) {
+ if (UNEXPECTED(param == NULL) || *param == NULL) {
+ if (param && *param == NULL) {
+ ALLOC_ZVAL(*param);
+ Z_SET_REFCOUNT_P(*param, 0);
+ Z_ADDREF_P(*param);
+ }
if (zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, NULL, opline->extended_value TSRMLS_CC)) {
const char *space;
const char *class_name;

0 comments on commit 4171c97

Please sign in to comment.