Skip to content

Cleanup name handling in magic methods #13733

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions Zend/zend_object_handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,6 @@ ZEND_API zval *zend_std_read_property(zend_object *zobj, zend_string *name, int
uintptr_t property_offset;
const zend_property_info *prop_info = NULL;
uint32_t *guard = NULL;
zend_string *tmp_name = NULL;

#if DEBUG_OBJECT_HANDLERS
fprintf(stderr, "Read object #%d property: %s\n", zobj->handle, ZSTR_VAL(name));
Expand Down Expand Up @@ -692,9 +691,6 @@ ZEND_API zval *zend_std_read_property(zend_object *zobj, zend_string *name, int
guard = zend_get_property_guard(zobj, name);

if (!((*guard) & IN_ISSET)) {
if (!tmp_name && !ZSTR_IS_INTERNED(name)) {
tmp_name = zend_string_copy(name);
}
GC_ADDREF(zobj);
ZVAL_UNDEF(&tmp_result);

Expand Down Expand Up @@ -769,8 +765,6 @@ ZEND_API zval *zend_std_read_property(zend_object *zobj, zend_string *name, int
retval = &EG(uninitialized_zval);

exit:
zend_tmp_string_release(tmp_name);

return retval;
}
/* }}} */
Expand Down Expand Up @@ -1822,7 +1816,6 @@ ZEND_API int zend_std_has_property(zend_object *zobj, zend_string *name, int has
zval *value = NULL;
uintptr_t property_offset;
const zend_property_info *prop_info = NULL;
zend_string *tmp_name = NULL;

property_offset = zend_get_property_offset(zobj->ce, name, 1, cache_slot, &prop_info);

Expand Down Expand Up @@ -1887,9 +1880,6 @@ ZEND_API int zend_std_has_property(zend_object *zobj, zend_string *name, int has
zval rv;

/* have issetter - try with it! */
if (!tmp_name && !ZSTR_IS_INTERNED(name)) {
tmp_name = zend_string_copy(name);
}
GC_ADDREF(zobj);
(*guard) |= IN_ISSET; /* prevent circular getting */
zend_std_call_issetter(zobj, name, &rv);
Expand All @@ -1912,7 +1902,6 @@ ZEND_API int zend_std_has_property(zend_object *zobj, zend_string *name, int has
}

exit:
zend_tmp_string_release(tmp_name);
return result;
}
/* }}} */
Expand Down