Closed Bug 1465981 Opened 2 years ago Closed 2 years ago

Use memcpy instead of type punning in BitwiseCast

Categories

(Core :: MFBT, enhancement)

enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla62
Tracking Status
firefox62 --- fixed

People

(Reporter: shu, Assigned: Waldo)

Details

Attachments

(1 file)

To get around strict aliasing, until such time bitcast becomes a standard thing.
Attached patch PatchSplinter Review
This uses the tack advocated near the end of <https://blog.regehr.org/archives/959>.
Attachment #8982973 - Flags: review?(nfroyd)
Assignee: nobody → jwalden+bmo
Status: NEW → ASSIGNED
Attachment #8982973 - Flags: review?(nfroyd) → review+
Pushed by jwalden@mit.edu:
https://hg.mozilla.org/integration/mozilla-inbound/rev/9b5279a09e13
Use memcpy instead of union-arm-punning (which has implementation-defined, desired behavior with gcc and presumably clang, and is not known to have problems on MSVC, but potentially could with other compilers) in BitwiseCast.  r=froydnj
https://hg.mozilla.org/mozilla-central/rev/9b5279a09e13
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
You need to log in before you can comment on or make changes to this bug.