Closed Bug 1184667 Opened 4 years ago Closed 4 years ago

Get rid of undefined behavior const_cast's in ActorsParent.cpp

Categories

(Core :: DOM: IndexedDB, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla42
Tracking Status
firefox42 --- fixed

People

(Reporter: reuben, Assigned: reuben)

Details

Attachments

(1 file)

ActorsParent.cpp has a bunch of const_cast removing constness of member variables in constructors, which is undefined behavior. We should get rid of those.
Assignee: nobody → reuben.bmo
Attachment #8635655 - Flags: review?(Jan.Varga)
Comment on attachment 8635655 [details] [diff] [review]
Remove const_casts

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

The original code looks nicer since those booleans never need to be modified, but I understand that in theory a compiler could place those variables into read-only memory, so it's not 100% safe to do the const_cast hack.

r=me
Attachment #8635655 - Flags: review?(Jan.Varga) → review+
https://hg.mozilla.org/mozilla-central/rev/56e99d4a3f04
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
You need to log in before you can comment on or make changes to this bug.