Skip to content

Commit b66168e

Browse files
committed
Fix maybe-uninitialized warning
Some GCC versions don't like zend_try in loop. Avoid the issue by pulling it out of the loop, we don't particularly care about skipping further warnings if a bailout occurs, just that it does not interrupt shutdown. Closes GH-7380.
1 parent e45a063 commit b66168e

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

ext/imap/php_imap.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -657,13 +657,13 @@ PHP_RSHUTDOWN_FUNCTION(imap)
657657
if (IMAPG(imap_errorstack) != NIL) {
658658
/* output any remaining errors at their original error level */
659659
if (EG(error_reporting) & E_NOTICE) {
660-
ecur = IMAPG(imap_errorstack);
661-
while (ecur != NIL) {
662-
zend_try {
660+
zend_try {
661+
ecur = IMAPG(imap_errorstack);
662+
while (ecur != NIL) {
663663
php_error_docref(NULL, E_NOTICE, "%s (errflg=%ld)", ecur->LTEXT, ecur->errflg);
664-
} zend_end_try();
665-
ecur = ecur->next;
666-
}
664+
ecur = ecur->next;
665+
}
666+
} zend_end_try();
667667
}
668668
mail_free_errorlist(&IMAPG(imap_errorstack));
669669
IMAPG(imap_errorstack) = NIL;
@@ -672,13 +672,13 @@ PHP_RSHUTDOWN_FUNCTION(imap)
672672
if (IMAPG(imap_alertstack) != NIL) {
673673
/* output any remaining alerts at E_NOTICE level */
674674
if (EG(error_reporting) & E_NOTICE) {
675-
acur = IMAPG(imap_alertstack);
676-
while (acur != NIL) {
677-
zend_try {
675+
zend_try {
676+
acur = IMAPG(imap_alertstack);
677+
while (acur != NIL) {
678678
php_error_docref(NULL, E_NOTICE, "%s", acur->LTEXT);
679-
} zend_end_try();
680-
acur = acur->next;
681-
}
679+
acur = acur->next;
680+
}
681+
} zend_end_try();
682682
}
683683
mail_free_stringlist(&IMAPG(imap_alertstack));
684684
IMAPG(imap_alertstack) = NIL;

0 commit comments

Comments
 (0)