Bug 33352

Summary: Passing array that is too large to set method of WebGLArrays does not throw an exception
Product: WebKit Reporter: Chris Marrin <cmarrin>
Component: WebGLAssignee: Kenneth Russell <kbr>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, dglazkov, eric, fishd, oliver, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
Patch
none
Revised patch none

Description Chris Marrin 2010-01-07 15:57:31 PST
The spec says it should but:

    var array = new WebGLFloatArray([1,2]);
    array.set([3, 4, 5]);

sets the array to [ 3, 4 ], rather than throwing.
Comment 1 Kenneth Russell 2010-01-07 17:18:42 PST
Created attachment 46099 [details]
Patch

Added needed range checks to JSC and V8 custom bindings. Expanded preexisting test suite for WebGLArrays and updated its expected results. Tested in WebKit and Chromium.
Comment 2 WebKit Review Bot 2010-01-07 17:25:09 PST
Attachment 46099 [details] did not pass style-queue:

Failed to run "WebKitTools/Scripts/check-webkit-style" exit_code: 1
WebCore/bindings/js/JSWebGLArrayHelper.h:35:  Alphabetical sorting problem.  [build/include_order] [4]
WebCore/bindings/js/JSWebGLArrayHelper.h:52:  One line control clauses should not use braces.  [whitespace/braces] [4]
WebCore/bindings/v8/custom/V8WebGLArrayCustom.h:179:  One line control clauses should not use braces.  [whitespace/braces] [4]
WebCore/bindings/v8/custom/V8WebGLArrayCustom.h:182:  One line control clauses should not use braces.  [whitespace/braces] [4]
Total errors found: 4
Comment 3 Kenneth Russell 2010-01-07 17:36:27 PST
Created attachment 46101 [details]
Revised patch

Fixed style errors in previous patch.
Comment 4 WebKit Review Bot 2010-01-07 17:41:14 PST
style-queue ran check-webkit-style on attachment 46101 [details] without any errors.
Comment 5 WebKit Commit Bot 2010-01-08 17:03:02 PST
Comment on attachment 46101 [details]
Revised patch

Clearing flags on attachment: 46101

Committed r53026: <http://trac.webkit.org/changeset/53026>
Comment 6 WebKit Commit Bot 2010-01-08 17:03:10 PST
All reviewed patches have been landed.  Closing bug.