RESOLVED FIXED 165923
Arguments called in wrong order
https://bugs.webkit.org/show_bug.cgi?id=165923
Summary Arguments called in wrong order
Brent Fulgham
Reported 2016-12-15 14:56:36 PST
Static analysis has identified several places where the order of arguments to functions does not match the expected signature.
Attachments
Patch (8.08 KB, patch)
2016-12-15 16:57 PST, Brent Fulgham
simon.fraser: review+
Brent Fulgham
Comment 1 2016-12-15 16:57:05 PST
I corrected a few other small bugs at the same time.
Brent Fulgham
Comment 2 2016-12-15 16:57:22 PST
Simon Fraser (smfr)
Comment 3 2016-12-15 17:12:17 PST
Comment on attachment 297257 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=297257&action=review > Source/WebCore/ChangeLog:3 > + Arguments called in wrong order That doesn't really cover all the problems. > Source/WebCore/platform/graphics/GraphicsContext3D.cpp:332 > - if (!computeFormatAndTypeParameters(format, type, &bytesPerComponent, &componentsPerPixel)) > + if (!computeFormatAndTypeParameters(format, type, &componentsPerPixel, &bytesPerComponent)) It seems like this should be testable.
Tim Horton
Comment 4 2016-12-15 17:24:36 PST
Comment on attachment 297257 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=297257&action=review > Tools/TestWebKitAPI/Tests/WebKit2/UserMedia.cpp:54 > - WKUserMediaPermissionRequestAllow(permissionRequest, videoDeviceUID.get(), audioDeviceUID.get()); > + WKUserMediaPermissionRequestAllow(permissionRequest, audioDeviceUID.get(), videoDeviceUID.get()); Seems bad that the test didn't catch this?
Brent Fulgham
Comment 5 2016-12-16 10:31:20 PST
Comment on attachment 297257 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=297257&action=review >> Source/WebCore/platform/graphics/GraphicsContext3D.cpp:332 >> + if (!computeFormatAndTypeParameters(format, type, &componentsPerPixel, &bytesPerComponent)) > > It seems like this should be testable. It's actually not, because the only use of 'bytesPerComponent' and 'componentsPerPixel' is to multiply by each-other and use that result. So this change is more about correctness than any actual behavior problem. I kind of wonder why we bother returning both values, since they are only ever used to do this one calculation. >> Tools/TestWebKitAPI/Tests/WebKit2/UserMedia.cpp:54 >> + WKUserMediaPermissionRequestAllow(permissionRequest, audioDeviceUID.get(), videoDeviceUID.get()); > > Seems bad that the test didn't catch this? Agreed!
Brent Fulgham
Comment 6 2016-12-16 10:33:03 PST
David Kilzer (:ddkilzer)
Comment 7 2016-12-19 16:19:04 PST
Antti: FYI, note the cache validation fix in Source/WebCore/platform/network/CacheValidation.cpp.
Note You need to log in before you can comment on or make changes to this bug.