Skip to content

Commit 4c01517

Browse files
committed
Revert "This works in my VM"
This reverts commit 026b1f0.
1 parent 026b1f0 commit 4c01517

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

Zend/zend_list.c

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -217,27 +217,25 @@ void zend_close_rsrc_list(HashTable *ht)
217217
/* Reload ht->arData on each iteration, as it may be reallocated. */
218218
uint32_t i = ht->nNumUsed;
219219

220-
while (1) {
221-
zend_try {
222-
while (i-- > 0) {
223-
zval *p = ZEND_HASH_ELEMENT(ht, i);
224-
if (Z_TYPE_P(p) != IS_UNDEF) {
225-
zend_resource *res = Z_PTR_P(p);
226-
if (res->type >= 0) {
227-
zend_resource_dtor(res);
228-
}
220+
retry:
221+
zend_try {
222+
while (i-- > 0) {
223+
zval *p = ZEND_HASH_ELEMENT(ht, i);
224+
if (Z_TYPE_P(p) != IS_UNDEF) {
225+
zend_resource *res = Z_PTR_P(p);
226+
if (res->type >= 0) {
227+
zend_resource_dtor(res);
229228
}
230229
}
231-
} zend_catch {
232-
/* If we have bailed, we probably executed user code (e.g. user stream
233-
* API). Keep closing resources so they don't leak. User handlers must be
234-
* called now so they aren't called in zend_deactivate() on
235-
* zend_destroy_rsrc_list(&EG(regular_list)). At that point, the executor
236-
* has already shut down and the process would crash. */
237-
continue;
238-
} zend_end_try();
239-
break;
240-
}
230+
}
231+
} zend_catch {
232+
/* If we have bailed, we probably executed user code (e.g. user stream
233+
* API). Keep closing resources so they don't leak. User handlers must be
234+
* called now so they aren't called in zend_deactivate() on
235+
* zend_destroy_rsrc_list(&EG(regular_list)). At that point, the executor
236+
* has already shut down and the process would crash. */
237+
goto retry;
238+
} zend_end_try();
241239
}
242240

243241

0 commit comments

Comments
 (0)