Skip to content

Commit eb1d45b

Browse files
committed
Restore opcache_invalidate() fuzzer behavior
The zend_exception_save() and zend_exception_restore() functions were removed in GH-20256. However, the fuzzer expects to be able to call opcache_invalidate() even if there was an exception thrown. I'm not sure why exactly, but let's restore the previous behavior. Closes OSS-Fuzz #476466130
1 parent 3ed4d2a commit eb1d45b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sapi/fuzzer/fuzzer-execute-common.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ ZEND_ATTRIBUTE_UNUSED static void create_file(void) {
134134

135135
ZEND_ATTRIBUTE_UNUSED static void opcache_invalidate(void) {
136136
steps_left = MAX_STEPS;
137+
zend_object *exception = EG(exception);
138+
EG(exception) = NULL;
137139
zval retval, args[2];
138140
zend_function *fn = zend_hash_str_find_ptr(CG(function_table), ZEND_STRL("opcache_invalidate"));
139141
ZEND_ASSERT(fn != NULL);
@@ -144,4 +146,5 @@ ZEND_ATTRIBUTE_UNUSED static void opcache_invalidate(void) {
144146
ZEND_ASSERT(Z_TYPE(retval) == IS_TRUE);
145147
zval_ptr_dtor(&args[0]);
146148
zval_ptr_dtor(&retval);
149+
EG(exception) = exception;
147150
}

0 commit comments

Comments
 (0)