Bug 1173908 - Fix an MSVC warning about negating an unsigned integer; r=nbp
authorTerrence Cole <terrence@mozilla.com>
Thu, 04 Jun 2015 12:43:10 -0700
changeset 279420 50f91f9d83835025f211f0c16958cd8cf288e96e
parent 279419 79fae794cc5a4333299401799d1df4cee13e5cb4
child 279421 36e0620d1c8faf9e752b354652e61e9917e41bd7
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-beta@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnbp
bugs1173908
milestone41.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1173908 - Fix an MSVC warning about negating an unsigned integer; r=nbp
js/src/jit/MacroAssembler-inl.h
js/src/jit/MacroAssembler.h
--- a/js/src/jit/MacroAssembler-inl.h
+++ b/js/src/jit/MacroAssembler-inl.h
@@ -23,26 +23,28 @@ MacroAssembler::framePushed() const
 
 void
 MacroAssembler::setFramePushed(uint32_t framePushed)
 {
     framePushed_ = framePushed;
 }
 
 void
-MacroAssembler::adjustFrame(int value)
+MacroAssembler::adjustFrame(int32_t value)
 {
+    MOZ_ASSERT_IF(value < 0, framePushed_ >= -value);
     setFramePushed(framePushed_ + value);
 }
 
 void
 MacroAssembler::implicitPop(uint32_t bytes)
 {
     MOZ_ASSERT(bytes % sizeof(intptr_t) == 0);
-    adjustFrame(-bytes);
+    MOZ_ASSERT(bytes <= INT32_MAX);
+    adjustFrame(-int32_t(bytes));
 }
 
 // ===============================================================
 // Stack manipulation functions.
 
 CodeOffsetLabel
 MacroAssembler::PushWithPatch(ImmWord word)
 {
--- a/js/src/jit/MacroAssembler.h
+++ b/js/src/jit/MacroAssembler.h
@@ -275,17 +275,17 @@ class MacroAssembler : public MacroAssem
     }
 
   public:
     // ===============================================================
     // Frame manipulation functions.
 
     inline uint32_t framePushed() const;
     inline void setFramePushed(uint32_t framePushed);
-    inline void adjustFrame(int value);
+    inline void adjustFrame(int32_t value);
 
     // Adjust the frame, to account for implicit modification of the stack
     // pointer, such that callee can remove arguments on the behalf of the
     // caller.
     inline void implicitPop(uint32_t bytes);
 
   private:
     // This field is used to statically (at compilation time) emulate a frame