RESOLVED FIXED253272
s_maxSize should be 'unsigned' rather than 'int' in WidthCache.h
https://bugs.webkit.org/show_bug.cgi?id=253272
Summary s_maxSize should be 'unsigned' rather than 'int' in WidthCache.h
Ahmad Saleem
Reported 2023-03-02 15:25:27 PST
Hi Team, I noticed that 's_maxSize' is int and it means that it can be negative while I think cache should be 0 or positive for which we should have it as 'unsigned'. WebKit Source - https://searchfox.org/wubkat/source/Source/WebCore/platform/graphics/WidthCache.h#217 static const int s_maxSize = 500000; Appreciate if someone can confirm my understanding and I am happy to do PR to fix it. Thanks!
Attachments
Ahmad Saleem
Comment 1 2023-03-04 18:37:54 PST
Just noticed that above - https://searchfox.org/wubkat/source/Source/WebCore/platform/graphics/WidthCache.h#204 There is this as well, where size() is unsigned in HashMap.h: m_map.size() < s_maxSize https://searchfox.org/wubkat/source/Source/WTF/wtf/HashMap.h#267 So we are comparing 'unsigned' with 'int'.
Myles C. Maxfield
Comment 2 2023-03-05 00:21:34 PST
Yes, the thing it's compared to is an unsigned, so it should be an unsigned too.
Ahmad Saleem
Comment 3 2023-03-05 04:12:23 PST
EWS
Comment 4 2023-03-05 20:06:06 PST
Committed 261252@main (315cbcb64568): <https://commits.webkit.org/261252@main> Reviewed commits have been landed. Closing PR #11082 and removing active labels.
Radar WebKit Bug Importer
Comment 5 2023-03-05 20:07:16 PST
Note You need to log in before you can comment on or make changes to this bug.