Closed Bug 1392885 Opened 7 years ago Closed 7 years ago

Make the debug message more clear when misusing Guard Object as a temp object

Categories

(Core :: MFBT, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: JamesCheng, Assigned: JamesCheng)

Details

Attachments

(1 file)

Misusing the guard object will bump into assertion failure.

http://searchfox.org/mozilla-central/rev/48ea452803907f2575d81021e8678634e8067fc2/mfbt/GuardObjects.h#119

But their is no debug message inside.

It is not straightforward.
Attachment #8900088 - Flags: review?(nfroyd)
Would marking the GuardObjectNotificationReceiver class definition with the MOZ_NON_TEMPORARY_CLASS or MOZ_RAII attribute catch this bug as compile time?
I don't think so, IIUC, the marker is for clang-format checking. We usually don't do that manually but meet this assertion with confusion.
Comment on attachment 8900088 [details]
Bug 1392885 -Add debug message when misusing the guard object.

https://reviewboard.mozilla.org/r/171438/#review176762
Attachment #8900088 - Flags: review?(nfroyd) → review+
Pushed by nfroyd@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5175f4c659a3
Add debug message when misusing the guard object. r=froydnj
I bumped into an error when I press "land commit".(but why?)

That is why you help me landing this patch?

Thank you.
https://hg.mozilla.org/mozilla-central/rev/5175f4c659a3
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: