Title: [288189] releases/WebKitGTK/webkit-2.34/Source/_javascript_Core
Revision
288189
Author
[email protected]
Date
2022-01-19 04:53:29 -0800 (Wed, 19 Jan 2022)

Log Message

Merge r284573 - Add missing overflow checks to DFGIntegerRangeOptimizationPhase::isEquivalentTo()
https://bugs.webkit.org/show_bug.cgi?id=232024

Reviewed by Tadeu Zagallo.

Added overflow check before comparing for equality.

* dfg/DFGIntegerRangeOptimizationPhase.cpp:

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.34/Source/_javascript_Core/ChangeLog (288188 => 288189)


--- releases/WebKitGTK/webkit-2.34/Source/_javascript_Core/ChangeLog	2022-01-19 12:53:24 UTC (rev 288188)
+++ releases/WebKitGTK/webkit-2.34/Source/_javascript_Core/ChangeLog	2022-01-19 12:53:29 UTC (rev 288189)
@@ -1,3 +1,14 @@
+2021-10-20  Michael Saboff  <[email protected]>
+
+        Add missing overflow checks to DFGIntegerRangeOptimizationPhase::isEquivalentTo()
+        https://bugs.webkit.org/show_bug.cgi?id=232024
+
+        Reviewed by Tadeu Zagallo.
+
+        Added overflow check before comparing for equality.
+
+        * dfg/DFGIntegerRangeOptimizationPhase.cpp:
+
 2021-10-18  Yusuke Suzuki  <[email protected]>
 
         Wasm Table can take arbitrary default value

Modified: releases/WebKitGTK/webkit-2.34/Source/_javascript_Core/dfg/DFGIntegerRangeOptimizationPhase.cpp (288188 => 288189)


--- releases/WebKitGTK/webkit-2.34/Source/_javascript_Core/dfg/DFGIntegerRangeOptimizationPhase.cpp	2022-01-19 12:53:24 UTC (rev 288188)
+++ releases/WebKitGTK/webkit-2.34/Source/_javascript_Core/dfg/DFGIntegerRangeOptimizationPhase.cpp	2022-01-19 12:53:29 UTC (rev 288189)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015-2020 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2021 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -228,8 +228,17 @@
         if (*this == other)
             return true;
 
-        if (m_right->isInt32Constant() && other.m_right->isInt32Constant())
-            return (m_right->asInt32() + m_offset) == (other.m_right->asInt32() + other.m_offset);
+        if (m_right->isInt32Constant() && other.m_right->isInt32Constant()) {
+            int thisRight = m_right->asInt32();
+            int otherRight = other.m_right->asInt32();
+
+            if (sumOverflows<int>(thisRight, m_offset))
+                return false;
+            if (sumOverflows<int>(otherRight, other.m_offset))
+                return false;
+
+            return (thisRight + m_offset) == (otherRight + other.m_offset);
+        }
         return false;
     }
     
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to