Bug 82436 - Web Inspector: REGRESSION: Stack overflow on the page with > 100kloc
Summary: Web Inspector: REGRESSION: Stack overflow on the page with > 100kloc
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Pavel Feldman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-28 01:14 PDT by Ilya Tikhonovsky
Modified: 2012-03-28 03:10 PDT (History)
10 users (show)

See Also:


Attachments
Patch (3.42 KB, patch)
2012-03-28 02:47 PDT, Pavel Feldman
yurys: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ilya Tikhonovsky 2012-03-28 01:14:15 PDT
this._setLine(range.startLine, prefix + newLines[0]);

            for (var i = 1; i < newLines.length; ++i)
                this._lines.splice(range.startLine + i, 0, newLines[i]);
            // Adjust attributes, attributes move with the first character of line.
            var spliceParameters = new Array(newLines.length + 1); // 2 + number of items to insert.
            spliceParameters[0] = range.startColumn ? range.startLine + 1 : range.startLine;
            spliceParameters[1] = 0;
here -->    this._attributes.splice.apply(this._attributes, spliceParameters);


spliceParameters is an preallocated array with ~132k elements
Comment 1 Pavel Feldman 2012-03-28 02:47:48 PDT
Created attachment 134246 [details]
Patch
Comment 2 Yury Semikhatsky 2012-03-28 02:58:12 PDT
Comment on attachment 134246 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=134246&action=review

> Source/WebCore/inspector/front-end/TextEditorModel.js:177
> +        for (var i = 1; i < newLines.length; ++i)

This looks weird here, can you add a comment?
Comment 3 Pavel Feldman 2012-03-28 03:10:33 PDT
Committed r112381: <http://trac.webkit.org/changeset/112381>