[Webkit-unassigned] [Bug 231606] ASSERT hit in surrogatePairAwareIndex and surrogatePairAwareStart lambdas for text with unpaired surrogates

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Oct 12 16:50:47 PDT 2021


https://bugs.webkit.org/show_bug.cgi?id=231606

--- Comment #9 from Gabriel Nava Marino <gnavamarino at apple.com> ---
(In reply to Darin Adler from comment #8)
> Comment on attachment 440982 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=440982&action=review
> 
> > Source/WebCore/layout/formattingContexts/inline/text/TextUtil.cpp:178
> >              // When the substring does not fit, the right side is supposed to be the start of the surrogate pair if applicable. 
> 
> One other thought, not something we need to do, but maybe worth considering.
> 
> The ICU library includes a macro for this specific operation,
> U16_SET_CP_START. We could just write:
> 
>     right = middle;
>     U16_SET_CP_START(text, 0, right);
> 
> Then we would not need to write the surrogatePairAwareStart function at all.

Thank you for pointing this out. I will try it!

> Perhaps there is a suitable macro for the surrogatePairAwareIndex operation
> too; I didn’t find it.

It looks like this could have been the closest one, but not quite:
U16_SET_CP_LIMIT(s, start, i, length)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20211012/1b5a520b/attachment.htm>


More information about the webkit-unassigned mailing list