Closed Bug 1301864 Opened 8 years ago Closed 8 years ago

Invalid constexpr specifiers in Value.h?

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla52
Tracking Status
firefox51 --- affected
firefox52 --- fixed

People

(Reporter: anba, Assigned: arai)

Details

Attachments

(1 file)

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: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
You need to log in before you can comment on or make changes to this bug.