Skip to content

Change fetch_type from int to uint32_t for fetch_class functions #9152

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
Jul 28, 2022
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions Zend/zend_execute.h
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,9 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_cannot_pass_by_reference(uint32_t arg
ZEND_API void zend_set_timeout(zend_long seconds, bool reset_signals);
ZEND_API void zend_unset_timeout(void);
ZEND_API ZEND_NORETURN void ZEND_FASTCALL zend_timeout(void);
ZEND_API zend_class_entry *zend_fetch_class(zend_string *class_name, int fetch_type);
ZEND_API zend_class_entry *zend_fetch_class_with_scope(zend_string *class_name, int fetch_type, zend_class_entry *scope);
ZEND_API zend_class_entry *zend_fetch_class_by_name(zend_string *class_name, zend_string *lcname, int fetch_type);
ZEND_API zend_class_entry *zend_fetch_class(zend_string *class_name, uint32_t fetch_type);
ZEND_API zend_class_entry *zend_fetch_class_with_scope(zend_string *class_name, uint32_t fetch_type, zend_class_entry *scope);
ZEND_API zend_class_entry *zend_fetch_class_by_name(zend_string *class_name, zend_string *lcname, uint32_t fetch_type);

ZEND_API zend_function * ZEND_FASTCALL zend_fetch_function(zend_string *name);
ZEND_API zend_function * ZEND_FASTCALL zend_fetch_function_str(const char *name, size_t len);
Expand Down
10 changes: 5 additions & 5 deletions Zend/zend_execute_API.c
Original file line number Diff line number Diff line change
Expand Up @@ -1534,7 +1534,7 @@ void zend_unset_timeout(void) /* {{{ */
}
/* }}} */

static ZEND_COLD void report_class_fetch_error(zend_string *class_name, int fetch_type)
static ZEND_COLD void report_class_fetch_error(zend_string *class_name, uint32_t fetch_type)
{
if (fetch_type & ZEND_FETCH_CLASS_SILENT) {
return;
Expand All @@ -1556,10 +1556,10 @@ static ZEND_COLD void report_class_fetch_error(zend_string *class_name, int fetc
}
}

zend_class_entry *zend_fetch_class(zend_string *class_name, int fetch_type) /* {{{ */
zend_class_entry *zend_fetch_class(zend_string *class_name, uint32_t fetch_type) /* {{{ */
{
zend_class_entry *ce, *scope;
int fetch_sub_type = fetch_type & ZEND_FETCH_CLASS_MASK;
uint32_t fetch_sub_type = fetch_type & ZEND_FETCH_CLASS_MASK;

check_fetch_type:
switch (fetch_sub_type) {
Expand Down Expand Up @@ -1605,7 +1605,7 @@ zend_class_entry *zend_fetch_class(zend_string *class_name, int fetch_type) /* {
/* }}} */

zend_class_entry *zend_fetch_class_with_scope(
zend_string *class_name, int fetch_type, zend_class_entry *scope)
zend_string *class_name, uint32_t fetch_type, zend_class_entry *scope)
{
zend_class_entry *ce;
switch (fetch_type & ZEND_FETCH_CLASS_MASK) {
Expand Down Expand Up @@ -1637,7 +1637,7 @@ zend_class_entry *zend_fetch_class_with_scope(
return ce;
}

zend_class_entry *zend_fetch_class_by_name(zend_string *class_name, zend_string *key, int fetch_type) /* {{{ */
zend_class_entry *zend_fetch_class_by_name(zend_string *class_name, zend_string *key, uint32_t fetch_type) /* {{{ */
{
zend_class_entry *ce = zend_lookup_class_ex(class_name, key, fetch_type);
if (!ce) {
Expand Down