RESOLVED FIXED 47248
WTF class CString confuses unsigned and size_t
https://bugs.webkit.org/show_bug.cgi?id=47248
Summary WTF class CString confuses unsigned and size_t
Chris Evans
Reported 2010-10-05 22:44:29 PDT
unsigned != size_t on a 64-bit build. Theoretically, a CString can have e.g. a 5GB string buffer on a 64-bit platform. There are various errors that would happen in such a case, such as "unsigned CString::length()" truncating the underlying size. Patch forthcoming.
Attachments
Patch (3.25 KB, patch)
2010-10-05 22:50 PDT, Chris Evans
no flags
Patch (3.28 KB, patch)
2010-10-05 23:20 PDT, Chris Evans
cevans: review-
Patch for EWS try bot (3.84 KB, patch)
2010-10-06 15:35 PDT, Chris Evans
no flags
Patch (3.85 KB, patch)
2010-10-06 23:05 PDT, Chris Evans
no flags
Patch (3.85 KB, patch)
2010-10-06 23:06 PDT, Chris Evans
no flags
Chris Evans
Comment 1 2010-10-05 22:50:42 PDT
David Levin
Comment 2 2010-10-05 23:04:29 PDT
Comment on attachment 69889 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=69889&action=review > JavaScriptCore/wtf/MD5.cpp:79 > + ASSERT_WITH_MESSAGE(actual == expected, "input:%s[%zu] actual:%s expected:%s", input.data(), input.length(), actual.data(), expected.data()); Does Visual Studio 2005 support this format?
David Levin
Comment 3 2010-10-05 23:17:01 PDT
Adding myself to cc list.
Chris Evans
Comment 4 2010-10-05 23:19:01 PDT
Good point. I did grep for '%zu' and got hits in dom/Node.cpp, but it seems like they are behind some heavy-duty define. The safest in-use paradigm seems to be usage of %lu plus a cast to unsigned long (e.g. DRT; WebSocketChannel.cpp; IconDatabase.cpp).
Eric Seidel (no email)
Comment 5 2010-10-05 23:20:03 PDT
Chris Evans
Comment 6 2010-10-05 23:20:50 PDT
David Levin
Comment 7 2010-10-05 23:27:49 PDT
Comment on attachment 69893 [details] Patch r+ if you fix the export issue for OSX and Windows (-- Sometime people submit the change with the OSX symbol and then get the symbol for windows for the build error on the buildbots).
Chris Evans
Comment 8 2010-10-05 23:34:39 PDT
Thanks -- I'll learn about the magic exports on Mac and Windows tomorrow :)
Chris Evans
Comment 9 2010-10-06 15:35:19 PDT
Created attachment 70000 [details] Patch for EWS try bot
Chris Evans
Comment 10 2010-10-06 15:42:26 PDT
Comment on attachment 70000 [details] Patch for EWS try bot Hmm - using r? to try and spur the bots into action
Chris Evans
Comment 11 2010-10-06 23:05:07 PDT
Chris Evans
Comment 12 2010-10-06 23:06:41 PDT
WebKit Commit Bot
Comment 13 2010-10-06 23:57:16 PDT
Comment on attachment 70039 [details] Patch Clearing flags on attachment: 70039 Committed r69277: <http://trac.webkit.org/changeset/69277>
WebKit Commit Bot
Comment 14 2010-10-06 23:57:22 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.