Commit e50cd125c9f for php.net
commit e50cd125c9fc273b7dab6e5f8746d32e2c01069e
Author: Ilija Tovilo <ilija.tovilo@me.com>
Date: Tue Apr 7 22:51:49 2026 +0200
Add EG(bailout) consistency assertion
Make sure EG(bailout) is what we expect. This will detect faulty jumps into or
out of zend_try blocks, as in 38628e8.
Closes GH-21667
diff --git a/Zend/zend.h b/Zend/zend.h
index c2c8d4ee6a2..c3323e4c4bf 100644
--- a/Zend/zend.h
+++ b/Zend/zend.h
@@ -275,7 +275,9 @@ typedef size_t (*zend_write_func_t)(const char *str, size_t str_length);
EG(bailout) = &__bailout; \
if (SETJMP(__bailout)==0) {
#define zend_catch \
+ ZEND_ASSERT(EG(bailout) == &__bailout); \
} else { \
+ ZEND_ASSERT(EG(bailout) == &__bailout); \
EG(bailout) = __orig_bailout;
#define zend_end_try() \
} \