Closed Bug 1213491 Opened 5 years ago Closed 5 years ago

Change CanvasRenderingContext2D::ContextState::clipsPushed to an nsTArray

Categories

(Core :: Graphics, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla44
Tracking Status
firefox44 --- fixed

People

(Reporter: jld, Assigned: jld)

References

Details

Attachments

(1 file)

Over in bug 1201314 I'm making our static analysis recognize that C++ Standard Library containers may not be safe to memmove().  After whitelisting std::pair and std::atomic, the only remaining exception is CanvasRenderingContext2D::ContextState::clipsPushed, which is a std::vector and is stored in the nsAutoTArray CanvasRenderingContext2D::mStyleStack which can memmove it.

std::vector isn't known to be a problem (yet), but it seems like a good idea to keep the analysis's whitelist small, and I understand that we usually prefer nsTArray anyway.
Attached patch PatchSplinter Review
Attachment #8672168 - Flags: review?(nical.bugzilla)
(In reply to Jed Davis [:jld] from comment #0)
> std::vector isn't known to be a problem (yet)

Update: it kind of is a problem, potentially; see bug 1201314 comment #18.
Attachment #8672168 - Flags: review?(nical.bugzilla) → review+
Thanks for the review.

Try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=e3d58e0a649f (failures seem to be not mine)
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/6f09fa0610f9
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
You need to log in before you can comment on or make changes to this bug.