Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. diff --git a/Zend/zend_gc.c b/Zend/zend_gc.c
  2. index 97a7edaac2..4dd0ed14c7 100644
  3. --- a/Zend/zend_gc.c
  4. +++ b/Zend/zend_gc.c
  5. @@ -1344,16 +1344,24 @@ static void gc_remove_nested_data_from_buffer(zend_refcounted *ref, gc_root_buff
  6. zval *zv;
  7.  
  8. tail_call:
  9. - if (root ||
  10. - (GC_REF_ADDRESS(ref) != 0 &&
  11. - GC_REF_CHECK_COLOR(ref, GC_BLACK))) {
  12. - GC_TRACE_REF(ref, "removing from buffer");
  13. + do {
  14. if (root) {
  15. + GC_TRACE_REF(ref, "removing from buffer");
  16. gc_remove_from_roots(root);
  17. GC_REF_SET_INFO(ref, 0);
  18. root = NULL;
  19. - } else {
  20. + } else if (GC_REF_ADDRESS(ref) != 0
  21. + && GC_REF_CHECK_COLOR(ref, GC_BLACK)) {
  22. + GC_TRACE_REF(ref, "removing from buffer");
  23. GC_REMOVE_FROM_BUFFER(ref);
  24. + } else if (GC_TYPE(ref) == IS_REFERENCE) {
  25. + if (Z_REFCOUNTED(((zend_reference*)ref)->val)) {
  26. + ref = Z_COUNTED(((zend_reference*)ref)->val);
  27. + goto tail_call;
  28. + }
  29. + return;
  30. + } else {
  31. + return;
  32. }
  33.  
  34. if (GC_TYPE(ref) == IS_OBJECT) {
  35. @@ -1389,12 +1397,6 @@ tail_call:
  36. }
  37. } else if (GC_TYPE(ref) == IS_ARRAY) {
  38. ht = (zend_array*)ref;
  39. - } else if (GC_TYPE(ref) == IS_REFERENCE) {
  40. - if (Z_REFCOUNTED(((zend_reference*)ref)->val)) {
  41. - ref = Z_COUNTED(((zend_reference*)ref)->val);
  42. - goto tail_call;
  43. - }
  44. - return;
  45. } else {
  46. return;
  47. }
  48. @@ -1430,7 +1432,7 @@ tail_call:
  49. }
  50. ref = Z_COUNTED_P(zv);
  51. goto tail_call;
  52. - }
  53. + } while (0);
  54. }
  55.  
  56. ZEND_API int zend_gc_collect_cycles(void)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement