From a692de40970befddc646f21c3990d3dac2f579b7 Mon Sep 17 00:00:00 2001 From: Terrence Cole Date: Thu, 4 Jun 2015 12:43:10 -0700 Subject: [PATCH] Bug 1173908 - Fix an MSVC warning about negating an unsigned integer; r=nbp --- js/src/jit/MacroAssembler-inl.h | 6 ++++-- js/src/jit/MacroAssembler.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/js/src/jit/MacroAssembler-inl.h b/js/src/jit/MacroAssembler-inl.h index 490543e36f8..4276e9519d1 100644 --- a/js/src/jit/MacroAssembler-inl.h +++ b/js/src/jit/MacroAssembler-inl.h @@ -28,8 +28,9 @@ MacroAssembler::setFramePushed(uint32_t framePushed) } void -MacroAssembler::adjustFrame(int value) +MacroAssembler::adjustFrame(int32_t value) { + MOZ_ASSERT_IF(value < 0, framePushed_ >= -value); setFramePushed(framePushed_ + value); } @@ -37,7 +38,8 @@ void MacroAssembler::implicitPop(uint32_t bytes) { MOZ_ASSERT(bytes % sizeof(intptr_t) == 0); - adjustFrame(-bytes); + MOZ_ASSERT(bytes <= INT32_MAX); + adjustFrame(-int32_t(bytes)); } // =============================================================== diff --git a/js/src/jit/MacroAssembler.h b/js/src/jit/MacroAssembler.h index cf57663828a..0fae63acb5d 100644 --- a/js/src/jit/MacroAssembler.h +++ b/js/src/jit/MacroAssembler.h @@ -280,7 +280,7 @@ class MacroAssembler : public MacroAssemblerSpecific 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