Bug 1419637 - do not call memset on a non-trivial type. r?jandem
MozReview-Commit-ID: DSTv14zw8Tp
--- a/js/src/jit/shared/Assembler-shared.h
+++ b/js/src/jit/shared/Assembler-shared.h
@@ -309,17 +309,18 @@ struct PatchedAbsoluteAddress
struct Address
{
Register base;
int32_t offset;
Address(Register base, int32_t offset) : base(base), offset(offset)
{ }
- Address() { mozilla::PodZero(this); }
+ Address() : base(Registers::Invalid), offset(0)
+ { }
};
#if JS_BITS_PER_WORD == 32
static inline Address
LowWord(const Address& address) {
CheckedInt<int32_t> offset = CheckedInt<int32_t>(address.offset) + INT64LOW_OFFSET;
MOZ_ALWAYS_TRUE(offset.isValid());
@@ -343,17 +344,22 @@ struct BaseIndex
Register index;
Scale scale;
int32_t offset;
BaseIndex(Register base, Register index, Scale scale, int32_t offset = 0)
: base(base), index(index), scale(scale), offset(offset)
{ }
- BaseIndex() { mozilla::PodZero(this); }
+ BaseIndex()
+ : base(Registers::Invalid)
+ , index(Registers::Invalid)
+ , scale(TimesOne)
+ , offset(0)
+ {}
};
#if JS_BITS_PER_WORD == 32
static inline BaseIndex
LowWord(const BaseIndex& address) {
CheckedInt<int32_t> offset = CheckedInt<int32_t>(address.offset) + INT64LOW_OFFSET;
MOZ_ALWAYS_TRUE(offset.isValid());