[Webkit-unassigned] [Bug 198518] REGRESSION(r245586): static assertion failed: Match result and EncodedMatchResult should be the same size

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jun 24 12:54:04 PDT 2019


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

--- Comment #8 from Michael Catanzaro <mcatanzaro at igalia.com> ---
Comment on attachment 372782
  --> https://bugs.webkit.org/attachment.cgi?id=372782
proposed patch

View in context: https://bugs.webkit.org/attachment.cgi?id=372782&action=review

> Source/JavaScriptCore/runtime/MatchResult.h      2019-06-24 18:36:36.947345256 +0000:43
>  #if CPU(ARM64) || CPU(X86_64)
> +#define ENCODEDMATCHRESULT_IS_MATCHRESULT 1
>  using EncodedMatchResult = MatchResult;
> -#else
> +#elif (defined(SIZE_WIDTH) && (SIZE_WIDTH == 32)) || (SIZE_MAX == 0xffffffff)
> +#define ENCODEDMATCHRESULT_IS_MATCHRESULT 0
>  using EncodedMatchResult = uint64_t;
> +#else
> +#define ENCODEDMATCHRESULT_IS_MATCHRESULT 1
> +using EncodedMatchResult = MatchResult;
>  #endif

Hm, well I see this should fix the problem. Thanks.

But it's really messy and honestly not great. Looking at the commit that introduced this build failure, r245586 "Cleanup Yarr regexp code around paren contexts," I see the code is rather complicated and I'm not confident in how to fix this nicely without reverting that change, but that commit was clearly incorrect. It assumes size_t is 32-bit except on x86_64 and aarch64, which is of course not right. The code only works if size_t happens to be the same as uint32_t, so I guess it should use uint32_t if that's what's desired. However, the constructor uses size_t and changing it to use uint32_t would require auditing a large number of callsites, so that should be left to JSC developers.

I've just visited bug #198063 to ask Keith to comment here. Let's see what he thinks.

-- 
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/20190624/713ff066/attachment.html>


More information about the webkit-unassigned mailing list