X Tutup
Skip to content

Follow-up grapheme_strrev#21345

Open
youkidearitai wants to merge 3 commits intophp:masterfrom
youkidearitai:followup-grapheme_strrev
Open

Follow-up grapheme_strrev#21345
youkidearitai wants to merge 3 commits intophp:masterfrom
youkidearitai:followup-grapheme_strrev

Conversation

@youkidearitai
Copy link
Contributor

I tried fix a grapheme_strrev.
Ref: #20949 (review)

CC: @ndossche @devnexen

current = ZSTR_LEN(string);
for (end = pstr; pos != UBRK_DONE; ) {
pos = ubrk_previous(bi);
if (pos == UBRK_DONE) {
Copy link
Member

Choose a reason for hiding this comment

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

any chance we get a test for this case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No I think we don't need it.

Copy link
Member

Choose a reason for hiding this comment

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

Is it possible that due to an error condition, the loop ends early and the NUL byte will be written on a position before the end?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably, There this is no early end. However, I found forget when ubrk_setUText is failure.

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.

3 participants

X Tutup