Note: There are a few cases of duplicates in user autocompletion which are being worked on.

use fallible allocation for potentially large buffers in nsTextFrameThebes.cpp

RESOLVED FIXED in mozilla12

Status

()

Core
Layout: Text
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: jfkthame, Assigned: jfkthame)

Tracking

Trunk
mozilla12
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
From bug 703100 comment 57:

We should review the existing buffer allocations in nsTextFrameThebes.cpp, and switch to fallible arrays in some cases where we're allocating space for a potentially huge string of text, and the code include checks for failure - it was clearly written assuming fallible arrays, but we've since changed the default behavior of arrays. The buffer passed to BuildTextRunForFrames, for example, should be allocated fallibly, as should the temporary buffer used when we need to "expand" 8- to 16-bit text. Basically, wherever we're doing "nsAutoTArray<T,BIG_TEXT_NODE_SIZE>", we probably want FallibleAutoTArray.
(Assignee)

Comment 1

6 years ago
Created attachment 588005 [details] [diff] [review]
patch, use fallible arrays for large text buffers
Assignee: nobody → jfkthame
Attachment #588005 - Flags: review?(roc)
Attachment #588005 - Flags: review?(roc) → review+

Comment 2

6 years ago
Backed out of inbound for multiple test failures:
https://tbpl.mozilla.org/?tree=Mozilla-Inbound&rev=148044813372

https://hg.mozilla.org/integration/mozilla-inbound/rev/7ee957b3e883
Status: NEW → ASSIGNED
(Assignee)

Comment 3

6 years ago
Re-landed without the change to how BuildTextRunForFrames is called (it needs to be able to return null for the textrun without this being treated as failure):
https://hg.mozilla.org/integration/mozilla-inbound/rev/4117cd7064ee
Target Milestone: --- → mozilla12
(Assignee)

Comment 4

6 years ago
https://hg.mozilla.org/mozilla-central/rev/4117cd7064ee
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.