Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: be7d4ca66743f064939eb9ed5f02b8d57661b517
https://github.com/WebKit/WebKit/commit/be7d4ca66743f064939eb9ed5f02b8d57661b517
Author: Sosuke Suzuki <[email protected]>
Date: 2026-07-01 (Wed, 01 Jul 2026)
Changed paths:
A JSTests/stress/temporal-int128-alignment-and-limits.js
M Source/WTF/wtf/Int128.h
M Source/cmake/OptionsCommon.cmake
M Tools/TestWebKitAPI/Tests/WTF/Int128.cpp
Log Message:
-----------
[WTF] `Int128` should fall back to `Int128Impl` when the standard library
does not support `__int128_t`
https://bugs.webkit.org/show_bug.cgi?id=318085
Reviewed by Yusuke Suzuki.
Some C++ standard libraries do not know that __int128_t exists. Under the
Microsoft STL, std::numeric_limits<__int128_t> falls through to the primary
template (is_signed == false, max() == 0), so CheckedArithmetic rejected
negative values fed into a Checked<Int128>; and the STL's #pragma pack(push, 8)
under-aligned __int128_t members inside library templates, so e.g.
std::pair<int64_t, Int128> placed its second member at offset 8 while
std::get() handed out a fully aligned reference, and the 16-byte-aligned loads
emitted through it faulted. In practice, every negative Temporal duration was
a RangeError, and Duration.prototype.round with relativeTo crashed. The
PlayStation ports' standard library has the same numeric_limits gap. The
aligned(16) typedef workaround from webkit.org/b/274765 does not help inside
templates, because template arguments are canonicalized.
Instead of teaching those configurations about __int128_t, stop using it
there: extend the CMake __int128_t check to require a functional
std::numeric_limits<__int128_t>, so HAVE(INT128_T) is unset under the
Microsoft and PlayStation STLs and WTF::Int128 falls back to the software
[U]Int128Impl, which has proper numeric_limits specializations, no alignment
assumptions the STL cannot honor, and is already exercised by other
configurations (e.g. watchOS). This also makes the clang-cl aligned-typedef
workaround dead, so remove it.
* JSTests/stress/temporal-int128-alignment-and-limits.js: Added.
* Source/WTF/wtf/Int128.h:
* Source/cmake/OptionsCommon.cmake:
* Tools/TestWebKitAPI/Tests/WTF/Int128.cpp:
Canonical link: https://commits.webkit.org/316358@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications