Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2015
603
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.00 KB | None | 0 0
  1. diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
  2. index 7bfa814..4ab2304 100644
  3. --- a/Zend/zend_vm_def.h
  4. +++ b/Zend/zend_vm_def.h
  5. @@ -3418,7 +3418,7 @@ ZEND_VM_HANDLER(63, ZEND_RECV, ANY, ANY)
  6.     ZEND_VM_NEXT_OPCODE();
  7.  }
  8.  
  9. -ZEND_VM_HANDLER(64, ZEND_RECV_INIT, ANY, CONST)
  10. +ZEND_VM_HANDLER(64, ZEND_RECV_INIT, ANY, CONST|TMP)
  11.  {
  12.     USE_OPLINE
  13.     zval *assignment_value;
  14. @@ -3429,21 +3429,26 @@ ZEND_VM_HANDLER(64, ZEND_RECV_INIT, ANY, CONST)
  15.     SAVE_OPLINE();
  16.     if (param == NULL) {
  17.         ALLOC_ZVAL(assignment_value);
  18. -       *assignment_value = *opline->op2.zv;
  19. -       if (IS_CONSTANT_TYPE(Z_TYPE_P(assignment_value))) {
  20. -           Z_SET_REFCOUNT_P(assignment_value, 1);
  21. -           zval_update_constant(&assignment_value, 0 TSRMLS_CC);
  22. -       } else if (Z_TYPE_P(assignment_value) == IS_ARRAY) {
  23. -           HashTable *ht;
  24. -
  25. -           ALLOC_HASHTABLE(ht);
  26. -           zend_hash_init(ht, zend_hash_num_elements(Z_ARRVAL_P(assignment_value)), NULL, ZVAL_PTR_DTOR, 0);
  27. -           zend_hash_copy(ht, Z_ARRVAL_P(assignment_value), (copy_ctor_func_t) zval_deep_copy, NULL, sizeof(zval *));
  28. -           Z_ARRVAL_P(assignment_value) = ht;
  29. +       if (OP2_TYPE == IS_CONST) {
  30. +           *assignment_value = *opline->op2.zv;
  31. +           if (IS_CONSTANT_TYPE(Z_TYPE_P(assignment_value))) {
  32. +               Z_SET_REFCOUNT_P(assignment_value, 1);
  33. +               zval_update_constant(&assignment_value, 0 TSRMLS_CC);
  34. +           } else if (Z_TYPE_P(assignment_value) == IS_ARRAY) {
  35. +               HashTable *ht;
  36. +
  37. +               ALLOC_HASHTABLE(ht);
  38. +               zend_hash_init(ht, zend_hash_num_elements(Z_ARRVAL_P(assignment_value)), NULL, ZVAL_PTR_DTOR, 0);
  39. +               zend_hash_copy(ht, Z_ARRVAL_P(assignment_value), (copy_ctor_func_t) zval_deep_copy, NULL, sizeof(zval *));
  40. +               Z_ARRVAL_P(assignment_value) = ht;
  41. +           } else {
  42. +               zval_copy_ctor(assignment_value);
  43. +           }
  44. +           INIT_PZVAL(assignment_value);
  45.         } else {
  46. -           zval_copy_ctor(assignment_value);
  47. +           *assignment_value = EX_T(opline->op2.var).tmp_var;
  48. +           INIT_PZVAL(assignment_value);
  49.         }
  50. -       INIT_PZVAL(assignment_value);
  51.     } else {
  52.         assignment_value = *param;
  53.         Z_ADDREF_P(assignment_value);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement