Closed Bug 1401191 Opened 4 years ago Closed 4 years ago

Initialize MoveOp::endCycleType_ to silence UBSan warning

Categories

(Core :: JavaScript Engine: JIT, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox57 --- wontfix
firefox58 --- fixed

People

(Reporter: anba, Assigned: anba)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

MoveOp::endCycleType_ is not initialized in the constructor, so when we copy MoveOps in http://searchfox.org/mozilla-central/rev/1c13d5cf85f904afb8976c02a80daa252b893fca/js/src/jit/MoveResolver.cpp#310,326,346 , we may end up accessing an initialized MoveOp::endCycleType_.
Attached patch bug1401191.patchSplinter Review
I haven't tested this (except for a small C++ standalone program to ensure uninitialized members can cause UBSan errors when copied in default copy-constructors), but it seems that this caused the UBSan error mentioned in the log in bug 1367146.
Attachment #8909784 - Flags: review?(nicolas.b.pierron)
Attachment #8909784 - Flags: review?(nicolas.b.pierron) → review+
Priority: -- → P2
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/7f85cf90d6f9
Initialize MoveOp::endCycleType_ to silence UBSan warning. r=nbp
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/7f85cf90d6f9
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in before you can comment on or make changes to this bug.