Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2c290815d4218ecc5a71fdb0eea444bedeb08755
      
https://github.com/WebKit/WebKit/commit/2c290815d4218ecc5a71fdb0eea444bedeb08755
  Author: Sosuke Suzuki <[email protected]>
  Date:   2026-06-04 (Thu, 04 Jun 2026)

  Changed paths:
    A JSTests/stress/temporal-plaindate-add-huge-days-out-of-range.js
    M Source/JavaScriptCore/runtime/temporal/core/ISOArithmetic.cpp

  Log Message:
  -----------
  [JSC][Temporal] `PlainDate` add/subtract with a huge day count fails a 
day-range assertion
https://bugs.webkit.org/show_bug.cgi?id=316368

Reviewed by Yusuke Suzuki.

balanceISODate returns the outOfRangeYear sentinel with the raw month/day
from WTF::yearMonthDayFromDays. Once the balanced date lands far enough past
the supported range (roughly 1.4e8 days from the epoch), that day falls
outside [1, 31], and isDateTimeWithinLimits hits the day-range assertion in
ExactTime::fromISOPartsAndOffset on Debug builds (Release correctly throws
RangeError). The out-of-range path now returns the fully-normalized
{ outOfRangeYear, 1, 1 } sentinel, matching the other out-of-range paths.

    new Temporal.PlainDate(2024, 1, 1).subtract({ days: 149645246 });
    // Expected: RangeError
    // Actual (Debug): ASSERTION FAILED: day >= 1 && day <= 31

Test: JSTests/stress/temporal-plaindate-add-huge-days-out-of-range.js

* JSTests/stress/temporal-plaindate-add-huge-days-out-of-range.js: Added.
(shouldThrow):
* Source/JavaScriptCore/runtime/temporal/core/ISOArithmetic.cpp:
(JSC::TemporalCore::balanceISODate):

Canonical link: https://commits.webkit.org/314613@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to