Skip to content
Open
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
4 changes: 2 additions & 2 deletions Zend/zend.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,12 @@ struct _zend_class_entry {
zend_class_entry *parent;
zend_string *parent_name;
};
int refcount;
uint32_t refcount;
uint32_t ce_flags;
uint32_t ce_flags2;

int default_properties_count;
int default_static_members_count;
uint32_t default_static_members_count;
zval *default_properties_table;
zval *default_static_members_table;
ZEND_MAP_PTR_DEF(zval *, static_members_table);
Expand Down
4 changes: 2 additions & 2 deletions Zend/zend_compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ ZEND_API zend_string *zend_get_compiled_filename(void) /* {{{ */
}
/* }}} */

ZEND_API int zend_get_compiled_lineno(void) /* {{{ */
ZEND_API uint32_t zend_get_compiled_lineno(void) /* {{{ */
{
return CG(zend_lineno);
}
Expand Down Expand Up @@ -4696,7 +4696,7 @@ static const zend_frameless_function_info *find_frameless_function_info(zend_ast

static uint32_t zend_compile_frameless_icall_ex(znode *result, zend_ast_list *args, zend_function *fbc, const zend_frameless_function_info *frameless_function_info, uint32_t type)
{
int lineno = CG(zend_lineno);
uint32_t lineno = CG(zend_lineno);
uint32_t num_args = frameless_function_info->num_args;
uint32_t offset = find_frameless_function_offset(num_args, frameless_function_info->handler);
znode arg_zvs[3];
Expand Down
2 changes: 1 addition & 1 deletion Zend/zend_compile.h
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ void shutdown_scanner(void);
ZEND_API zend_string *zend_set_compiled_filename(zend_string *new_compiled_filename);
ZEND_API void zend_restore_compiled_filename(zend_string *original_compiled_filename);
ZEND_API zend_string *zend_get_compiled_filename(void);
ZEND_API int zend_get_compiled_lineno(void);
ZEND_API uint32_t zend_get_compiled_lineno(void);
ZEND_API size_t zend_get_scanned_file_offset(void);

ZEND_API zend_string *zend_get_compiled_variable_name(const zend_op_array *op_array, uint32_t var);
Expand Down
6 changes: 3 additions & 3 deletions Zend/zend_globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ struct _zend_compiler_globals {

zend_string *compiled_filename;

int zend_lineno;
uint32_t zend_lineno;

zend_op_array *active_op_array;

Expand Down Expand Up @@ -204,7 +204,7 @@ struct _zend_executor_globals {

zend_execute_data *current_observed_frame;

int ticks_count;
uint32_t ticks_count;

zend_long precision;

Expand Down Expand Up @@ -343,7 +343,7 @@ struct _zend_ini_scanner_globals {
zend_stack state_stack;

zend_string *filename;
int lineno;
uint32_t lineno;

/* Modes are: ZEND_INI_SCANNER_NORMAL, ZEND_INI_SCANNER_RAW, ZEND_INI_SCANNER_TYPED */
int scanner_mode;
Expand Down
2 changes: 1 addition & 1 deletion Zend/zend_ini_parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ static ZEND_COLD void ini_error(const char *msg)
error_buf_len = 128 + (int)strlen(msg) + (int)strlen(currently_parsed_filename); /* should be more than enough */
error_buf = (char *) emalloc(error_buf_len);

sprintf(error_buf, "%s in %s on line %d\n", msg, currently_parsed_filename, zend_ini_scanner_get_lineno());
sprintf(error_buf, "%s in %s on line %" PRIu32 "\n", msg, currently_parsed_filename, zend_ini_scanner_get_lineno());
} else {
error_buf = estrdup("Invalid configuration directive\n");
}
Expand Down
2 changes: 1 addition & 1 deletion Zend/zend_ini_scanner.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ typedef struct _zend_file_handle zend_file_handle;
#define ZEND_INI_SCANNER_TYPED 2 /* Typed mode. */

BEGIN_EXTERN_C()
ZEND_COLD int zend_ini_scanner_get_lineno(void);
ZEND_COLD uint32_t zend_ini_scanner_get_lineno(void);
ZEND_COLD const char *zend_ini_scanner_get_filename(void);
zend_result zend_ini_open_file_for_scanning(zend_file_handle *fh, int scanner_mode);
zend_result zend_ini_prepare_string_for_scanning(const char *str, int scanner_mode);
Expand Down
2 changes: 1 addition & 1 deletion Zend/zend_ini_scanner.l
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ void shutdown_ini_scanner(void)
/* }}} */

/* {{{ zend_ini_scanner_get_lineno() */
ZEND_COLD int zend_ini_scanner_get_lineno(void)
ZEND_COLD uint32_t zend_ini_scanner_get_lineno(void)
{
return SCNG(lineno);
}
Expand Down
3 changes: 1 addition & 2 deletions Zend/zend_object_handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -2001,7 +2001,6 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_st

ZEND_API void zend_class_init_statics(zend_class_entry *class_type) /* {{{ */
{
int i;
zval *p;

if (class_type->default_static_members_count && !CE_STATIC_MEMBERS(class_type)) {
Expand All @@ -2010,7 +2009,7 @@ ZEND_API void zend_class_init_statics(zend_class_entry *class_type) /* {{{ */
}

ZEND_MAP_PTR_SET(class_type->static_members_table, emalloc(sizeof(zval) * class_type->default_static_members_count));
for (i = 0; i < class_type->default_static_members_count; i++) {
for (uint32_t i = 0; i < class_type->default_static_members_count; i++) {
p = &class_type->default_static_members_table[i];
if (Z_TYPE_P(p) == IS_INDIRECT) {
zval *q = &CE_STATIC_MEMBERS(class_type->parent)[i];
Expand Down
2 changes: 1 addition & 1 deletion Zend/zend_vm_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -8005,7 +8005,7 @@ ZEND_VM_HANDLER(105, ZEND_TICKS, ANY, ANY, NUM)
{
USE_OPLINE

if ((uint32_t)++EG(ticks_count) >= opline->extended_value) {
if (++EG(ticks_count) >= opline->extended_value) {
EG(ticks_count) = 0;
if (zend_ticks_function) {
SAVE_OPLINE();
Expand Down
4 changes: 2 additions & 2 deletions Zend/zend_vm_execute.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions ext/opcache/zend_persist.c
Original file line number Diff line number Diff line change
Expand Up @@ -967,12 +967,11 @@ zend_class_entry *zend_persist_class_entry(zend_class_entry *orig_ce)
}
}
if (ce->default_static_members_table) {
int i;
ce->default_static_members_table = zend_shared_memdup_free(ce->default_static_members_table, sizeof(zval) * ce->default_static_members_count);

/* Persist only static properties in this class.
* Static properties from parent classes will be handled in class_copy_ctor and are marked with IS_INDIRECT */
for (i = 0; i < ce->default_static_members_count; i++) {
for (uint32_t i = 0; i < ce->default_static_members_count; i++) {
if (Z_TYPE(ce->default_static_members_table[i]) != IS_INDIRECT) {
zend_persist_zval(&ce->default_static_members_table[i]);
}
Expand Down
4 changes: 1 addition & 3 deletions ext/opcache/zend_persist_calc.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,10 +479,8 @@ void zend_persist_class_entry_calc(zend_class_entry *ce)
}
}
if (ce->default_static_members_table) {
int i;

ADD_SIZE(sizeof(zval) * ce->default_static_members_count);
for (i = 0; i < ce->default_static_members_count; i++) {
for (uint32_t i = 0; i < ce->default_static_members_count; i++) {
if (Z_TYPE(ce->default_static_members_table[i]) != IS_INDIRECT) {
zend_persist_zval_calc(&ce->default_static_members_table[i]);
}
Expand Down