Skip to content

Commit fac3d7b

Browse files
committed
Zend: Convert certain fields to uint32_t
1 parent 6009b8a commit fac3d7b

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

Zend/zend_compile.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,9 +535,9 @@ static zend_always_inline uint32_t get_temporary_variable(void) /* {{{ */
535535
}
536536
/* }}} */
537537

538-
static int lookup_cv(zend_string *name) /* {{{ */{
538+
static uint32_t lookup_cv(zend_string *name) /* {{{ */{
539539
zend_op_array *op_array = CG(active_op_array);
540-
int i = 0;
540+
uint32_t i = 0;
541541
zend_ulong hash_value = zend_string_hash_val(name);
542542

543543
while (i < op_array->last_var) {

Zend/zend_compile.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ typedef struct _zend_oparray_context {
197197
struct _zend_oparray_context *prev;
198198
zend_op_array *op_array;
199199
uint32_t opcodes_size;
200-
int vars_size;
200+
uint32_t vars_size;
201201
int literals_size;
202202
uint32_t fast_call_var;
203203
uint32_t try_catch_offset;
@@ -529,9 +529,9 @@ struct _zend_op_array {
529529
const zend_property_info *prop_info; /* The corresponding prop_info if this is a hook. */
530530
/* END of common elements */
531531

532-
int cache_size; /* number of run_time_cache_slots * sizeof(void*) */
533-
int last_var; /* number of CV variables */
534-
uint32_t last; /* number of opcodes */
532+
uint32_t cache_size; /* number of run_time_cache_slots * sizeof(void*) */
533+
uint32_t last_var; /* number of CV variables */
534+
uint32_t last; /* number of opcodes */
535535

536536
zend_op *opcodes;
537537
ZEND_MAP_PTR_DEF(HashTable *, static_variables_ptr);
@@ -695,16 +695,16 @@ ZEND_STATIC_ASSERT(ZEND_MM_ALIGNED_SIZE(sizeof(zval)) == sizeof(zval),
695695
"zval must be aligned by ZEND_MM_ALIGNMENT");
696696
/* A number of call frame slots (zvals) reserved for zend_execute_data. */
697697
#define ZEND_CALL_FRAME_SLOT \
698-
((int)((sizeof(zend_execute_data) + sizeof(zval) - 1) / sizeof(zval)))
698+
((sizeof(zend_execute_data) + sizeof(zval) - 1) / sizeof(zval))
699699

700700
#define ZEND_CALL_VAR(call, n) \
701-
((zval*)(((char*)(call)) + ((int)(n))))
701+
((zval*)(((char*)(call)) + (n)))
702702

703703
#define ZEND_CALL_VAR_NUM(call, n) \
704-
(((zval*)(call)) + (ZEND_CALL_FRAME_SLOT + ((int)(n))))
704+
(((zval*)(call)) + (ZEND_CALL_FRAME_SLOT + (n)))
705705

706706
#define ZEND_CALL_ARG(call, n) \
707-
ZEND_CALL_VAR_NUM(call, ((int)(n)) - 1)
707+
ZEND_CALL_VAR_NUM(call, (n) - 1)
708708

709709
#define EX(element) ((execute_data)->element)
710710

0 commit comments

Comments
 (0)