From 06f9978e52a8408ed6c2c8296afb1e7449c2f1ee Mon Sep 17 00:00:00 2001 From: Mark Lam Date: Thu, 10 Nov 2022 18:30:42 -0800 Subject: [PATCH] Change the value of scriptCodeLimit to placate a strange Clang quirk. https://bugs.webkit.org/show_bug.cgi?id=247770 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 --- Source/WTF/wtf/URLHelpers.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/WTF/wtf/URLHelpers.cpp b/Source/WTF/wtf/URLHelpers.cpp index c21ba8bfa92c1..5538b00d460b9 100644 --- a/Source/WTF/wtf/URLHelpers.cpp +++ b/Source/WTF/wtf/URLHelpers.cpp @@ -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 @@ -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(256); +constexpr auto scriptCodeLimit = static_cast(255); + static uint32_t allowedIDNScriptBits[(scriptCodeLimit + 31) / 32];