Initialize only the necessary fields.

This commit is contained in:
Dmitry Stogov 2016-05-31 00:04:52 +03:00
parent 6bd3b8108a
commit f216176bc9
2 changed files with 6 additions and 2 deletions

View File

@ -4038,7 +4038,9 @@ ZEND_VM_HANDLER(41, ZEND_GENERATOR_CREATE, ANY, ANY)
generator = (zend_generator *) Z_OBJ_P(EX(return_value));
generator->execute_data = gen_execute_data;
generator->frozen_call_stack = NULL;
memset(&generator->execute_fake, 0, sizeof(zend_execute_data));
generator->execute_fake.opline = NULL;
generator->execute_fake.func = NULL;
generator->execute_fake.prev_execute_data = NULL;
ZVAL_OBJ(&generator->execute_fake.This, (zend_object *) generator);
gen_execute_data->opline = opline + 1;

View File

@ -1179,7 +1179,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_CREATE_SPEC_HANDLER(
generator = (zend_generator *) Z_OBJ_P(EX(return_value));
generator->execute_data = gen_execute_data;
generator->frozen_call_stack = NULL;
memset(&generator->execute_fake, 0, sizeof(zend_execute_data));
generator->execute_fake.opline = NULL;
generator->execute_fake.func = NULL;
generator->execute_fake.prev_execute_data = NULL;
ZVAL_OBJ(&generator->execute_fake.This, (zend_object *) generator);
gen_execute_data->opline = opline + 1;