Bug 1443342 - Don't blacklist nsCSSProps.cpp:SortPropertyAndCount from integer-overflow sanitizing. r=froydnj

--HG--
extra : rebase_source : b5d9da242923e0ae43abf6a508e0298b64741466
This commit is contained in:
Jeff Walden 2018-03-06 09:34:04 -08:00
Родитель 212527bdf1
Коммит 76b527d6d8
3 изменённых файлов: 7 добавлений и 10 удалений

Просмотреть файл

@ -149,10 +149,6 @@ fun:*OT*collect_glyphs*
# These look like harmless layouting-related overflows
src:*/gfx/cairo/libpixman/src/pixman-region.c
# Sorting code in layout/style/nsCSSProps.cpp that probably doesn't
# care about overflows.
fun:*SortPropertyAndCount*
# Code in ipc/chromium/src/base/file_path.cc where a function returns -1
# being cast to unsigned and then overflowed.
fun:*FilePath*Append*

Просмотреть файл

@ -156,10 +156,6 @@ fun:*OT*collect_glyphs*
# These look like harmless layouting-related overflows
src:*/gfx/cairo/libpixman/src/pixman-region.c
# Sorting code in layout/style/nsCSSProps.cpp that probably doesn't
# care about overflows.
fun:*SortPropertyAndCount*
# Code in ipc/chromium/src/base/file_path.cc where a function returns -1
# being cast to unsigned and then overflowed.
fun:*FilePath*Append*

Просмотреть файл

@ -12,6 +12,7 @@
#include "nsCSSProps.h"
#include "mozilla/ArrayUtils.h"
#include "mozilla/Casting.h"
#include "nsCSSKeywords.h"
#include "nsLayoutUtils.h"
@ -140,9 +141,13 @@ SortPropertyAndCount(const void* s1, const void* s2, void *closure)
{
const PropertyAndCount *pc1 = static_cast<const PropertyAndCount*>(s1);
const PropertyAndCount *pc2 = static_cast<const PropertyAndCount*>(s2);
// Primary sort by count (lowest to highest)
if (pc1->count != pc2->count)
return pc1->count - pc2->count;
if (pc1->count != pc2->count) {
return AssertedCast<int32_t>(pc1->count) -
AssertedCast<int32_t>(pc2->count);
}
// Secondary sort by property index (highest to lowest)
return pc2->property - pc1->property;
}