1
0
mirror of https://github.com/php/php-src.git synced 2026-03-29 19:52:20 +02:00

Unserialize op_array->scope before passing to zend_file_cache_unserialize_type().

Don't use scope of closures.
This commit is contained in:
Dmitry Stogov
2021-02-10 23:55:59 +03:00
parent ef51648185
commit b113f7e88e

View File

@@ -1352,6 +1352,8 @@ static void zend_file_cache_unserialize_op_array(zend_op_array *op_arr
opline++;
}
UNSERIALIZE_PTR(op_array->scope);
if (op_array->arg_info) {
zend_arg_info *p, *end;
UNSERIALIZE_PTR(op_array->arg_info);
@@ -1367,7 +1369,7 @@ static void zend_file_cache_unserialize_op_array(zend_op_array *op_arr
if (!IS_UNSERIALIZED(p->name)) {
UNSERIALIZE_STR(p->name);
}
zend_file_cache_unserialize_type(&p->type, op_array->scope, script, buf);
zend_file_cache_unserialize_type(&p->type, (op_array->fn_flags & ZEND_ACC_CLOSURE) ? NULL : op_array->scope, script, buf);
p++;
}
}
@@ -1389,7 +1391,6 @@ static void zend_file_cache_unserialize_op_array(zend_op_array *op_arr
UNSERIALIZE_STR(op_array->function_name);
UNSERIALIZE_STR(op_array->filename);
UNSERIALIZE_PTR(op_array->live_range);
UNSERIALIZE_PTR(op_array->scope);
UNSERIALIZE_STR(op_array->doc_comment);
UNSERIALIZE_ATTRIBUTES(op_array->attributes);
UNSERIALIZE_PTR(op_array->try_catch_array);