1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/Zend/tests
Niels Dossche 27035eb01e Fix GH-20085: Assertion failure when combining lazy object get_properties exception with foreach loop
In this test, we will loop once, and then replace the object with an
instance that'll throw on property construction in Z_OBJPROP_P() in
the ZEND_FE_FETCH_RW VM handler.
Since at that point `pos >= fe_ht->nNumUsed`, we exit via
`fe_fetch_w_exit` without checking for an exception, causing incorrect
continuation of the code and an eventual assertion failure.

To solve this, we perform an exception check at the end of the
iteration. This should be sufficient to guarantee the exception is
checked in time as failure of get_properties() via Z_OBJPROP_P() will
always result in an empty hash table.
This should also be more efficient than the alternative fix that checks
for an exception right after Z_OBJPROP_P() as that would be executed at
each iteration.

Closes GH-20098.
2025-10-08 17:34:38 +02:00
..
2025-01-31 10:21:32 +01:00
2025-07-01 18:50:41 +02:00
2025-06-25 03:20:49 +05:30
2023-10-18 17:34:10 +02:00
2023-10-18 17:34:10 +02:00
2023-10-18 17:34:10 +02:00
2023-10-18 17:34:10 +02:00
2023-10-18 17:34:10 +02:00
2023-10-18 17:34:10 +02:00
2023-10-18 17:34:10 +02:00
2023-10-18 17:34:10 +02:00
2024-07-14 11:55:03 +02:00
2022-09-19 13:12:49 +03:00
2022-03-20 20:54:36 +01:00
2022-03-20 20:54:36 +01:00
2022-03-20 20:54:36 +01:00
2022-03-20 20:54:36 +01:00
2022-03-20 20:54:36 +01:00
2023-04-16 15:34:56 +02:00
2023-04-16 15:34:56 +02:00
2023-03-06 15:03:19 +01:00
2025-06-25 03:20:49 +05:30
2024-01-14 19:12:41 +01:00
2024-01-21 23:24:00 +01:00
2024-01-21 23:24:00 +01:00
2024-01-21 23:24:00 +01:00
2024-01-21 23:24:00 +01:00
2024-01-21 23:24:00 +01:00
2024-03-26 12:33:44 +01:00
2024-03-26 12:33:44 +01:00
2024-03-26 12:33:44 +01:00
2025-09-03 18:14:43 +02:00
2025-05-19 19:05:32 +02:00
2023-10-18 17:34:10 +02:00
2023-10-18 17:34:10 +02:00
2023-07-25 17:54:14 +02:00
2022-09-26 11:43:38 +03:00