Bug 1018255 - Fix a short-circuit evaluation bug in OverscrollSnapBackAnimation::Sample. r=kats
authorBotond Ballo <botond@mozilla.com>
Tue, 03 Jun 2014 17:31:25 -0400
changeset 207623 1495e351283ef0d3474f7bfc2835fcfa61ae6890
parent 207622 e761f600d11af62691fd587d28d2f62fc1338d85
child 207624 05ce4d3cf94e8f03e81569340337122802d096c0
push id494
push userraliiev@mozilla.com
push dateMon, 25 Aug 2014 18:42:16 +0000
treeherdermozilla-release@a3cc3e46b571 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1018255
milestone32.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 1018255 - Fix a short-circuit evaluation bug in OverscrollSnapBackAnimation::Sample. r=kats
gfx/layers/apz/src/AsyncPanZoomController.cpp
--- a/gfx/layers/apz/src/AsyncPanZoomController.cpp
+++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp
@@ -483,18 +483,20 @@ public:
   {
     mApzc.mX.StartSnapBack();
     mApzc.mY.StartSnapBack();
   }
 
   virtual bool Sample(FrameMetrics& aFrameMetrics,
                       const TimeDuration& aDelta) MOZ_OVERRIDE
   {
-    return mApzc.mX.SampleSnapBack(aDelta)
-        || mApzc.mY.SampleSnapBack(aDelta);
+    // Can't inline these variables due to short-circuit evaluation.
+    bool continueX = mApzc.mX.SampleSnapBack(aDelta);
+    bool continueY = mApzc.mY.SampleSnapBack(aDelta);
+    return continueX || continueY;
   }
 
 private:
   AsyncPanZoomController& mApzc;
 };
 
 void
 AsyncPanZoomController::SetFrameTime(const TimeStamp& aTime) {