Skip to content

Commit ef938d5

Browse files
committed
Revert "Disable destructors on fuzzer bailout"
This reverts commit ed33262. With adjusted bailout handling in fibers, this should no longer be necessary.
1 parent af29059 commit ef938d5

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

sapi/fuzzer/fuzzer-execute.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,14 @@ static uint32_t steps_left;
2727
* we can assume that we don't use global registers / hybrid VM. */
2828
typedef int (ZEND_FASTCALL *opcode_handler_t)(zend_execute_data *);
2929

30-
static ZEND_NORETURN void fuzzer_bailout() {
31-
/* Disable object destructors, like we would do for fatal errors. In particular, if we
32-
* perform a bailout from a fiber to the main stack, we should not try to destroy the
33-
* fiber. */
34-
zend_objects_store_mark_destructed(&EG(objects_store));
35-
zend_bailout();
36-
}
37-
3830
static void fuzzer_execute_ex(zend_execute_data *execute_data) {
3931
while (1) {
4032
int ret;
4133
if (--steps_left == 0) {
4234
/* Reset steps before bailing out, so code running after bailout (e.g. in
4335
* destructors) will get another MAX_STEPS, rather than UINT32_MAX steps. */
4436
steps_left = MAX_STEPS;
45-
fuzzer_bailout();
37+
zend_bailout();
4638
}
4739

4840
if ((ret = ((opcode_handler_t) EX(opline)->handler)(execute_data)) != 0) {
@@ -60,7 +52,7 @@ static zend_op_array *(*orig_compile_string)(zend_string *source_string, const c
6052
static zend_op_array *fuzzer_compile_string(zend_string *str, const char *filename) {
6153
if (ZSTR_LEN(str) > MAX_SIZE) {
6254
/* Avoid compiling huge inputs via eval(). */
63-
fuzzer_bailout();
55+
zend_bailout();
6456
}
6557

6658
return orig_compile_string(str, filename);

0 commit comments

Comments
 (0)