Skip to content

Commit 4341795

Browse files
committed
Remove redundant Generator::__wakeup() method
Generators already make use of (un)serialize_deny, so there's no need to additionally have a throwing __wakeup() implementation.
1 parent 67b9108 commit 4341795

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

Zend/zend_generators.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,22 +1070,6 @@ ZEND_METHOD(Generator, getReturn)
10701070
}
10711071
/* }}} */
10721072

1073-
/* {{{ proto Generator::__wakeup()
1074-
* Throws an Exception as generators can't be serialized */
1075-
ZEND_METHOD(Generator, __wakeup)
1076-
{
1077-
/* Just specifying the zend_class_unserialize_deny handler is not enough,
1078-
* because it is only invoked for C unserialization. For O the error has
1079-
* to be thrown in __wakeup. */
1080-
1081-
if (zend_parse_parameters_none() == FAILURE) {
1082-
return;
1083-
}
1084-
1085-
zend_throw_exception(NULL, "Unserialization of 'Generator' is not allowed", 0);
1086-
}
1087-
/* }}} */
1088-
10891073
/* get_iterator implementation */
10901074

10911075
static void zend_generator_iterator_dtor(zend_object_iterator *iterator) /* {{{ */
@@ -1212,7 +1196,6 @@ static const zend_function_entry generator_functions[] = {
12121196
ZEND_ME(Generator, send, arginfo_generator_send, ZEND_ACC_PUBLIC)
12131197
ZEND_ME(Generator, throw, arginfo_generator_throw, ZEND_ACC_PUBLIC)
12141198
ZEND_ME(Generator, getReturn,arginfo_generator_void, ZEND_ACC_PUBLIC)
1215-
ZEND_ME(Generator, __wakeup, arginfo_generator_void, ZEND_ACC_PUBLIC)
12161199
ZEND_FE_END
12171200
};
12181201

0 commit comments

Comments
 (0)