Bug 1342316 - Check eCSSUnit_Calc_Plus' array length in assertion. r?heycam draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Fri, 28 Apr 2017 07:52:02 +0900
changeset 569868 b126fda18c753e5e2f2086224ed23d17de0f9df7
parent 569701 2cca333f546f38860f84940d4c72d7470a3410f4
child 569869 d2332a5f57498e30ec055a2fd2645a0e8db95834
child 569872 e925e97143fd59d516120c34c4fb40ce11f886e3
child 569873 7d86a97ac4f7730acdce1e45b509293bfbe68922
push id56288
push userhikezoe@mozilla.com
push dateThu, 27 Apr 2017 23:15:50 +0000
reviewersheycam
bugs1342316
milestone55.0a1
Bug 1342316 - Check eCSSUnit_Calc_Plus' array length in assertion. r?heycam MozReview-Commit-ID: 9bxXrl36FtA
layout/style/nsCSSValue.cpp
--- a/layout/style/nsCSSValue.cpp
+++ b/layout/style/nsCSSValue.cpp
@@ -868,17 +868,17 @@ nsCSSValue::GetCalcValue() const
     result.mLength = rootValue.GetFloatValue();
     result.mPercent = 0.0f;
     result.mHasPercent = false;
   } else {
     MOZ_ASSERT(rootValue.GetUnit() == eCSSUnit_Calc_Plus,
                "Calc unit should be eCSSUnit_Calc_Plus");
 
     const nsCSSValue::Array *calcPlusArray = rootValue.GetArrayValue();
-    MOZ_ASSERT(array->Count() == 2,
+    MOZ_ASSERT(calcPlusArray->Count() == 2,
                "eCSSUnit_Calc_Plus should have a 2-length array");
 
     const nsCSSValue& length = calcPlusArray->Item(0);
     const nsCSSValue& percent = calcPlusArray->Item(1);
     MOZ_ASSERT(length.GetUnit() == eCSSUnit_Pixel,
                "The first value should be eCSSUnit_Pixel");
     MOZ_ASSERT(percent.GetUnit() == eCSSUnit_Percent,
                "The first value should be eCSSUnit_Percent");