Skip to content

Optimizer: add const qualifiers#22009

Open
Girgias wants to merge 1 commit into
php:masterfrom
Girgias:dfa_pass_const
Open

Optimizer: add const qualifiers#22009
Girgias wants to merge 1 commit into
php:masterfrom
Girgias:dfa_pass_const

Conversation

@Girgias
Copy link
Copy Markdown
Member

@Girgias Girgias commented May 11, 2026

No description provided.

@Girgias Girgias marked this pull request as ready for review May 19, 2026 18:12
@Girgias Girgias requested a review from dstogov as a code owner May 19, 2026 18:12
@Girgias Girgias requested a review from TimWolla May 25, 2026 09:00
Copy link
Copy Markdown
Member

@TimWolla TimWolla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really my area of expertise for me to give a meaningful opinion.

Comment thread Zend/Optimizer/pass3.c
jmp_hitlist = (zend_op**)do_alloca(sizeof(zend_op*)*op_array->last, use_heap);
opline = op_array->opcodes;
end = opline + op_array->last;
const zend_op *end = opline + op_array->last;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not seem to be particularly useful - and slightly confusing - to make just end a const pointer if the only thing that's done with it is compare pointers.

Did you mean zend_op *const end instead?


blocks = cfg.blocks;
end = blocks + cfg.blocks_count;
const zend_basic_block *end = blocks + cfg.blocks_count;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants