Skip to content

Commit f42c333

Browse files
committed
Code review
1 parent bc660fc commit f42c333

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ext/reflection/php_reflection.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1495,10 +1495,9 @@ ZEND_METHOD(ReflectionFunction, __construct)
14951495
if (closure_obj) {
14961496
fptr = (zend_function*)zend_get_closure_method_def(closure_obj);
14971497
} else {
1498-
ALLOCA_FLAG(use_heap)
1499-
15001498
if (UNEXPECTED(ZSTR_VAL(fname)[0] == '\\')) {
15011499
/* Ignore leading "\" */
1500+
ALLOCA_FLAG(use_heap)
15021501
ZSTR_ALLOCA_ALLOC(lcname, ZSTR_LEN(fname) - 1, use_heap);
15031502
zend_str_tolower_copy(ZSTR_VAL(lcname), ZSTR_VAL(fname) + 1, ZSTR_LEN(fname) - 1);
15041503
fptr = zend_fetch_function(lcname);
@@ -1603,7 +1602,7 @@ ZEND_METHOD(ReflectionFunctionAbstract, getClosureScopeClass)
16031602
}
16041603
GET_REFLECTION_OBJECT();
16051604
if (!Z_ISUNDEF(intern->obj)) {
1606-
closure_func = zend_get_closure_method_def(Z_OBJ_P(&intern->obj));
1605+
closure_func = zend_get_closure_method_def(Z_OBJ(intern->obj));
16071606
if (closure_func && closure_func->common.scope) {
16081607
zend_reflection_class_factory(closure_func->common.scope, return_value);
16091608
}
@@ -3053,6 +3052,7 @@ ZEND_METHOD(ReflectionMethod, __construct)
30533052
&& memcmp(lcname, ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1) == 0
30543053
&& (mptr = zend_get_closure_invoke_method(Z_OBJ_P(orig_obj))) != NULL)
30553054
{
3055+
/* do nothing, mptr already set */
30563056
} else if ((mptr = zend_hash_str_find_ptr(&ce->function_table, lcname, name_len)) == NULL) {
30573057
efree(lcname);
30583058
zend_throw_exception_ex(reflection_exception_ptr, 0,

0 commit comments

Comments
 (0)