Closed Bug 969866 Opened 6 years ago Closed 6 years ago

Use fallible allocations in some places in our font/text shaping code

Categories

(Core :: Graphics, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla30

People

(Reporter: ehsan, Assigned: ehsan)

References

Details

Attachments

(1 file, 1 obsolete file)

It seems like the sizes for these data structures can be controlled from
Web content, and we are already prepared to deal with OOM conditions,
except that we are using infallible allocations by mistake.
Assignee: nobody → ehsan
Blocks: 969864
It seems like the sizes for these data structures can be controlled from
Web content, and we are already prepared to deal with OOM conditions,
except that we are using infallible allocations by mistake.
Attachment #8372837 - Attachment is obsolete: true
Attachment #8372838 - Flags: review?(jfkthame)
Comment on attachment 8372838 [details] [diff] [review]
Use fallible allocations in some places in our font/text shaping code; r=jfkthame

Review of attachment 8372838 [details] [diff] [review]:
-----------------------------------------------------------------

LGTM, thanks. (I expect some of this code predates the move to infallible-by-default, and just never got updated...)
Attachment #8372838 - Flags: review?(jfkthame) → review+
(In reply to Jonathan Kew (:jfkthame) from comment #3)
> Comment on attachment 8372838 [details] [diff] [review]
> Use fallible allocations in some places in our font/text shaping code;
> r=jfkthame
> 
> Review of attachment 8372838 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> LGTM, thanks. (I expect some of this code predates the move to
> infallible-by-default, and just never got updated...)

Yeah that's very plausible.  This is a footgun which I'm fixing in bug 969864.  That will convert patterns such as:

  nsTArray<Foo> foos;
  if (!foos.SetLength(AskContentToCrashUs())) {
    // pretend we're handling OOMs here!
  }

not compile, which is how I found this.  :-)
https://hg.mozilla.org/mozilla-central/rev/d4f859c2f0e0
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
You need to log in before you can comment on or make changes to this bug.