Invalid constexpr specifiers in Value.h?

RESOLVED FIXED in Firefox 52

Status

()

defect
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: anba, Assigned: arai)

Tracking

Trunk
mozilla52
Points:
---

Firefox Tracking Flags

(firefox51 affected, firefox52 fixed)

Details

Attachments

(1 attachment)

In js/public/Value.h

Value CanonicalizedDoubleValue(double d)
- CanonicalizedDoubleValue is marked as constexpr, but it uses mozilla::IsNaN which calls mozilla::BitwiseCast, and BitCast isn't constexpr, which means CanonicalizedDoubleValue can't be constexpr.
- And even if the call to mozilla::IsNaN is replaced with `d != d` to make CanonicalizedDoubleValue constexpr, we can only access the asDouble member from jsval_layout in a constexpr context, because asBits isn't initialized. 

Value NumberValue(uint32_t i)
- NumberValue is marked constexpr, but it calls CanonicalizedDoubleValue which isn't constexpr per above.
Will fix after bug 1304191.
Assignee: nobody → arai.unmht
Status: NEW → ASSIGNED
for now, removing constexpr from mozilla::IsNaN here.
others may be handled in bug 1311088.
Attachment #8803688 - Flags: review?(jwalden+bmo)
Comment on attachment 8803688 [details] [diff] [review]
Part 1: Remove constexpr from mozilla::IsNaN.

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

Sest la vee.
Attachment #8803688 - Flags: review?(jwalden+bmo) → review+
https://hg.mozilla.org/mozilla-central/rev/83ab2e59b7b5
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
You need to log in before you can comment on or make changes to this bug.