mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1206105 - Use CheckedInt for an+b selector matching. r=bzbarsky
This commit is contained in:
parent
0b54e8c9c7
commit
5cef0df81e
6
layout/style/crashtests/1206105-1.html
Normal file
6
layout/style/crashtests/1206105-1.html
Normal file
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>crashtest, bug 1206105</title>
|
||||
<style>
|
||||
*:nth-child(-n-2147483647) {}
|
||||
</style>
|
||||
<body>
|
@ -121,5 +121,6 @@ load 1163446-1.html
|
||||
load 1164813-1.html
|
||||
load 1167782-1.html
|
||||
load 1200568-1.html
|
||||
load 1206105-1.html
|
||||
load large_border_image_width.html
|
||||
load border-image-visited-link.html
|
||||
|
@ -1571,8 +1571,11 @@ nthChildGenericMatches(Element* aElement,
|
||||
// Integer division in C does truncation (towards 0). So
|
||||
// check that the result is nonnegative, and that there was no
|
||||
// truncation.
|
||||
const int32_t n = (index - b) / a;
|
||||
return n >= 0 && (a * n == index - b);
|
||||
const CheckedInt<int32_t> indexMinusB = CheckedInt<int32_t>(index) - b;
|
||||
const CheckedInt<int32_t> n = indexMinusB / a;
|
||||
return n.isValid() &&
|
||||
n.value() >= 0 &&
|
||||
a * n == indexMinusB;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
|
Loading…
Reference in New Issue
Block a user