NEW 118275
[WTF]: Fix out-of-bounds subscript gcc 4.8 warning in dtoa/double-conversion.cc
https://bugs.webkit.org/show_bug.cgi?id=118275
Summary [WTF]: Fix out-of-bounds subscript gcc 4.8 warning in dtoa/double-conversion.cc
Sergio Correia (qrwteyrutiyoup)
Reported 2013-07-01 19:58:46 PDT
[WTF]: Fix subscript out-of-bound gcc 4.8 warning in dtoa/double-conversion.cc
Attachments
Patch (1.70 KB, patch)
2013-07-01 20:05 PDT, Sergio Correia (qrwteyrutiyoup)
no flags
Archive of layout-test-results from APPLE-EWS-3 for win-future (841.43 KB, application/zip)
2013-07-02 15:46 PDT, Build Bot
no flags
Sergio Correia (qrwteyrutiyoup)
Comment 1 2013-07-01 20:05:09 PDT
Sergio Correia (qrwteyrutiyoup)
Comment 2 2013-07-01 21:32:39 PDT
Warning: /home/sergio/projects/webkitnix/Source/WTF/wtf/dtoa/double-conversion.cc: In static member function 'static double WTF::double_conversion::StringToDoubleConverter::StringToDouble(const char*, size_t, size_t*)': /home/sergio/projects/webkitnix/Source/WTF/wtf/dtoa/double-conversion.cc:597:26: error: array subscript is above array bounds [-Werror=array-bounds]
Darin Adler
Comment 3 2013-07-02 12:13:08 PDT
Comment on attachment 205858 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=205858&action=review > Source/WTF/wtf/dtoa/double-conversion.cc:449 > - char buffer[kBufferSize]; // NOLINT: size is known at compile time. > + char buffer[kBufferSize + 1]; // NOLINT: size is known at compile time. > + buffer[kBufferSize] = '\0'; I don’t understand this. The code below always null-character-terminates the buffer, and the buffer is always large enough. This seems like a useless change driven by an incorrect compiler warning. Am I wrong? If so, tell me why.
Sergio Correia (qrwteyrutiyoup)
Comment 4 2013-07-02 14:00:10 PDT
(In reply to comment #3) > (From update of attachment 205858 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=205858&action=review > > > Source/WTF/wtf/dtoa/double-conversion.cc:449 > > - char buffer[kBufferSize]; // NOLINT: size is known at compile time. > > + char buffer[kBufferSize + 1]; // NOLINT: size is known at compile time. > > + buffer[kBufferSize] = '\0'; > > I don’t understand this. The code below always null-character-terminates the buffer, and the buffer is always large enough. This seems like a useless change driven by an incorrect compiler warning. > > Am I wrong? If so, tell me why. You are right, the problem seems to be the warning itself, in this case. Just checked out and there are a few reports of bogus warnings for the array bounds checking in gcc's bugzilla. And yeah, this boils down to a useless change to silence the compiler, which was needed because it's treating warnings as errors.
Build Bot
Comment 5 2013-07-02 15:46:10 PDT
Comment on attachment 205858 [details] Patch Attachment 205858 [details] did not pass win-ews (win): Output: http://webkit-queues.appspot.com/results/938890 New failing tests: fast/forms/select/popup-closes-on-blur.html
Build Bot
Comment 6 2013-07-02 15:46:11 PDT
Created attachment 205951 [details] Archive of layout-test-results from APPLE-EWS-3 for win-future The attached test failures were seen while running run-webkit-tests on the win-ews. Bot: APPLE-EWS-3 Port: win-future Platform: CYGWIN_NT-6.1-WOW64-1.7.20-0.266-5-3-i686-32bit
Note You need to log in before you can comment on or make changes to this bug.