Bug 1419637 - do not call memset on a non-trivial type. r?Ms2ger draft
authorAndi-Bogdan Postelnicu <bpostelnicu@mozilla.com>
Wed, 22 Nov 2017 16:49:52 +0200
changeset 701992 0b65bf6cdfaed282013e752064e8dfe9b7e4b9b9
parent 701872 5378dcb45044a160fad93b02eed0c617f3324dbc
child 741319 5baa7d7397b0599f516e908ab7a5555c6ebe49ee
push id90331
push userbmo:bpostelnicu@mozilla.com
push dateWed, 22 Nov 2017 14:50:15 +0000
reviewersMs2ger
bugs1419637
milestone59.0a1
Bug 1419637 - do not call memset on a non-trivial type. r?Ms2ger MozReview-Commit-ID: DSTv14zw8Tp
js/src/jit/shared/Assembler-shared.h
--- 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() : 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,18 @@ 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() : 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());