-
Notifications
You must be signed in to change notification settings - Fork 8k
Zend/zend_compile.h: use uint32_t type for zend_op_array.last_var #21543
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -539,7 +539,7 @@ static zend_always_inline uint32_t get_temporary_variable(void) /* {{{ */ | |
|
|
||
| static uint32_t lookup_cv(zend_string *name) /* {{{ */{ | ||
| zend_op_array *op_array = CG(active_op_array); | ||
| int i = 0; | ||
| uint32_t i = 0; | ||
| zend_ulong hash_value = zend_string_hash_val(name); | ||
|
|
||
| while (i < op_array->last_var) { | ||
|
|
@@ -8486,9 +8486,8 @@ static void zend_compile_closure_uses(zend_ast *ast) /* {{{ */ | |
| ZVAL_NULL(&zv); | ||
|
|
||
| { | ||
| int i; | ||
| for (i = 0; i < op_array->last_var; i++) { | ||
| if (zend_string_equals(op_array->vars[i], var_name)) { | ||
| for (uint32_t j = 0; j < op_array->last_var; j++) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand the switch in variable name here. There's no surrounding
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was getting a shadowing warning. I'll double check. |
||
| if (zend_string_equals(op_array->vars[j], var_name)) { | ||
| zend_error_noreturn_unchecked(E_COMPILE_ERROR, | ||
| "Cannot use lexical variable $%S as a parameter name", var_name); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -661,7 +661,7 @@ static int zend_jit_trace_add_phis(zend_jit_trace_rec *trace_buffer, uint32_t ss | |
| { | ||
| const zend_op_array *op_array; | ||
| zend_jit_trace_rec *p; | ||
| int k, vars_count; | ||
| uint32_t vars_count; | ||
| zend_bitset use, def; | ||
| uint32_t build_flags = ZEND_SSA_RC_INFERENCE | ZEND_SSA_USE_CV_RESULTS; | ||
| uint32_t set_size; | ||
|
|
@@ -712,7 +712,7 @@ static int zend_jit_trace_add_phis(zend_jit_trace_rec *trace_buffer, uint32_t ss | |
| } else { | ||
| vars_count = op_array->last_var + op_array->T; | ||
| } | ||
| for (k = 0; k < vars_count; k++) { | ||
| for (uint32_t k = 0; k < vars_count; k++) { | ||
| if (zend_bitset_in(use, k)) { | ||
| zend_ssa_phi *phi = zend_arena_calloc(&CG(arena), 1, | ||
| ZEND_MM_ALIGNED_SIZE(sizeof(zend_ssa_phi)) + | ||
|
|
@@ -7814,7 +7814,8 @@ static void zend_jit_dump_trace(zend_jit_trace_rec *trace_buffer, zend_ssa *tssa | |
| const zend_op_array *op_array; | ||
| const zend_op *opline; | ||
| uint32_t level = 1 + trace_buffer[0].level; | ||
| int idx, len, i, v, vars_count, call_level; | ||
| int len, v; | ||
| uint32_t idx, i, vars_count, call_level; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems quite inconsistent, the same variables are declared many times in the JIT files, and
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm happy to make the |
||
|
|
||
| ZEND_ASSERT(p->op == ZEND_JIT_TRACE_START); | ||
| op_array = p->op_array; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😕 This this warn? That's pretty error prone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was breaking opcache, not sure why.