Skip to content

Commit

Permalink
Change the value of scriptCodeLimit to placate a strange Clang quirk.
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=247770
<rdar://problem/102115540>

Reviewed by Alex Christensen.

Some versions of Clang appear to think that scriptCodeLimit should fit in a signed
9-bit integer, which is crazy.  For our purposes, a value of 255 works just as well.
So, we're changing scriptCodeLimit to be 255 instead of 256 to work around this Clang
quirk.

* Source/WTF/wtf/URLHelpers.cpp:

Canonical link: https://commits.webkit.org/256560@main
  • Loading branch information
Mark Lam committed Nov 11, 2022
1 parent a79f5b8 commit 06f9978
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Source/WTF/wtf/URLHelpers.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2019 Apple Inc. All rights reserved.
* Copyright (C) 2005-2022 Apple Inc. All rights reserved.
* Copyright (C) 2018 Igalia S.L.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -48,7 +48,8 @@ constexpr unsigned urlBytesBufferLength = 2048;
// WebKit was compiled.
// This is only really important for platforms that load an external IDN allowed script list.
// Not important for the compiled-in one.
constexpr auto scriptCodeLimit = static_cast<UScriptCode>(256);
constexpr auto scriptCodeLimit = static_cast<UScriptCode>(255);


static uint32_t allowedIDNScriptBits[(scriptCodeLimit + 31) / 32];

Expand Down

0 comments on commit 06f9978

Please sign in to comment.