Bug 825949 followup: in nsGlobalWindow::SetTimeoutOrInterval, make |realInterval| unsigned, since it's known-nonnegative and is passed elsewhere as an unsigned integer. r=smaug
authorDaniel Holbert <dholbert@cs.stanford.edu>
Thu, 03 Jan 2013 13:48:52 -0800
changeset 126607 8b397adc49e9c280d469821402c972aaeca45fa2
parent 126606 4d3dab3786d84a82e39c7a654c02688d2cd0988a
child 126608 ea71cfcffb9fce065a8d038c47e47ded6bb1ac95
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs825949
milestone20.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 825949 followup: in nsGlobalWindow::SetTimeoutOrInterval, make |realInterval| unsigned, since it's known-nonnegative and is passed elsewhere as an unsigned integer. r=smaug
dom/base/nsGlobalWindow.cpp
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -9566,21 +9566,21 @@ nsGlobalWindow::SetTimeoutOrInterval(nsI
 
   nsRefPtr<nsTimeout> timeout = new nsTimeout();
   timeout->mIsInterval = aIsInterval;
   timeout->mInterval = interval;
   timeout->mScriptHandler = aHandler;
 
   // Now clamp the actual interval we will use for the timer based on
   uint32_t nestingLevel = sNestingLevel + 1;
-  int32_t realInterval = interval;
+  uint32_t realInterval = interval;
   if (aIsInterval || nestingLevel >= DOM_CLAMP_TIMEOUT_NESTING_LEVEL) {
     // Don't allow timeouts less than DOMMinTimeoutValue() from
     // now...
-    realInterval = NS_MAX(realInterval, DOMMinTimeoutValue());
+    realInterval = NS_MAX(realInterval, uint32_t(DOMMinTimeoutValue()));
   }
 
   // Get principal of currently executing code, save for execution of timeout.
   // If our principals subsume the subject principal then use the subject
   // principal. Otherwise, use our principal to avoid running script in
   // elevated principals.
 
   nsCOMPtr<nsIPrincipal> subjectPrincipal;