Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 884c93a89477439436e11c1081dcc73312599cd7
      
https://github.com/WebKit/WebKit/commit/884c93a89477439436e11c1081dcc73312599cd7
  Author: David Degazio <d_dega...@apple.com>
  Date:   2024-04-23 (Tue, 23 Apr 2024)

  Changed paths:
    M Source/WTF/wtf/MathExtras.h
    M Tools/TestWebKitAPI/Tests/WTF/MathExtras.cpp

  Log Message:
  -----------
  Make WTF::negate work correctly when negating non-negative integers
https://bugs.webkit.org/show_bug.cgi?id=273048
rdar://problem/126872453

Reviewed by Yusuke Suzuki and Keith Miller.

WTF::negate statically accepts signed integers, but ASSERTs that its input is
already negative so it can return a non-negative result. This is pretty 
surprising
behavior, and since the operation of WTF::negate is a simple two's-complement
negate, it should be fine to allow it to return negative results as well.

* Source/WTF/wtf/MathExtras.h:
(WTF::negate):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to