Skip to content

Commit b113f7e

Browse files
committed
Unserialize op_array->scope before passing to zend_file_cache_unserialize_type().
Don't use scope of closures.
1 parent ef51648 commit b113f7e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ext/opcache/zend_file_cache.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,6 +1352,8 @@ static void zend_file_cache_unserialize_op_array(zend_op_array *op_arr
13521352
opline++;
13531353
}
13541354

1355+
UNSERIALIZE_PTR(op_array->scope);
1356+
13551357
if (op_array->arg_info) {
13561358
zend_arg_info *p, *end;
13571359
UNSERIALIZE_PTR(op_array->arg_info);
@@ -1367,7 +1369,7 @@ static void zend_file_cache_unserialize_op_array(zend_op_array *op_arr
13671369
if (!IS_UNSERIALIZED(p->name)) {
13681370
UNSERIALIZE_STR(p->name);
13691371
}
1370-
zend_file_cache_unserialize_type(&p->type, op_array->scope, script, buf);
1372+
zend_file_cache_unserialize_type(&p->type, (op_array->fn_flags & ZEND_ACC_CLOSURE) ? NULL : op_array->scope, script, buf);
13711373
p++;
13721374
}
13731375
}
@@ -1389,7 +1391,6 @@ static void zend_file_cache_unserialize_op_array(zend_op_array *op_arr
13891391
UNSERIALIZE_STR(op_array->function_name);
13901392
UNSERIALIZE_STR(op_array->filename);
13911393
UNSERIALIZE_PTR(op_array->live_range);
1392-
UNSERIALIZE_PTR(op_array->scope);
13931394
UNSERIALIZE_STR(op_array->doc_comment);
13941395
UNSERIALIZE_ATTRIBUTES(op_array->attributes);
13951396
UNSERIALIZE_PTR(op_array->try_catch_array);

0 commit comments

Comments
 (0)