зеркало из https://github.com/mozilla/gecko-dev.git
Bug 674522 - Fix jsval_layout on 64-bit big-endian platforms (r=waldo)
This commit is contained in:
Родитель
c1f1127ab0
Коммит
163c7f654a
|
@ -313,7 +313,6 @@ typedef union jsval_layout
|
|||
int32 i32;
|
||||
uint32 u32;
|
||||
JSWhyMagic why;
|
||||
jsuword word;
|
||||
} payload;
|
||||
} s;
|
||||
double asDouble;
|
||||
|
@ -350,11 +349,11 @@ typedef union jsval_layout
|
|||
uint64 payload47 : 47;
|
||||
} debugView;
|
||||
struct {
|
||||
uint32 padding;
|
||||
union {
|
||||
int32 i32;
|
||||
uint32 u32;
|
||||
JSWhyMagic why;
|
||||
jsuword word;
|
||||
} payload;
|
||||
} s;
|
||||
double asDouble;
|
||||
|
@ -363,6 +362,8 @@ typedef union jsval_layout
|
|||
# endif /* JS_BITS_PER_WORD */
|
||||
#endif /* defined(IS_LITTLE_ENDIAN) */
|
||||
|
||||
JS_STATIC_ASSERT(sizeof(jsval_layout) == 8);
|
||||
|
||||
#if JS_BITS_PER_WORD == 32
|
||||
|
||||
/*
|
||||
|
|
|
@ -743,7 +743,11 @@ class Value
|
|||
}
|
||||
|
||||
const jsuword *payloadWord() const {
|
||||
return &data.s.payload.word;
|
||||
#if JS_BITS_PER_WORD == 32
|
||||
return reinterpret_cast<const jsuword *>(&data.s.payload.word);
|
||||
#elif JS_BITS_PER_WORD == 64
|
||||
return reinterpret_cast<const jsuword *>(&data.asBits);
|
||||
#endif
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
Загрузка…
Ссылка в новой задаче