Closed Bug 865306 Opened 7 years ago Closed 7 years ago

Add assertions for the initialization of the cycle collector's EdgePool::Iterators

Categories

(Core :: XPCOM, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla23

People

(Reporter: mccr8, Assigned: mccr8)

References

Details

Attachments

(1 file)

A common mistake when changing how the CC graph built, at least for me, is to forget to set the first or last child of a node.  This results in null pointer crashes in weird places.  It is easier to diagnose these problems if we check any time the EdgePool::Iterator is touched that it is initialized.

I'm going to put these behind a special #define because this is not a very useful check unless you are altering how the graph is built.  These kinds of mistakes will result in crashing even without the assertions, the assertions just make them easier to diagnose.  I personally only find it useful once or twice a year.
Attached patch add assertsSplinter Review
Attachment #741373 - Flags: review?(bugs)
Comment on attachment 741373 [details] [diff] [review]
add asserts

I think I've never hacked PtrInfo. But if this is useful for you...
Attachment #741373 - Flags: review?(bugs) → review+
https://hg.mozilla.org/mozilla-central/rev/c253479e2a2e
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
You need to log in before you can comment on or make changes to this bug.