From 0e51a147822f6121c1ad222baf5f5db0818650bf Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Mon, 30 Jan 2017 21:38:44 -0800 Subject: [PATCH] Bug 1335308 - Assert against non-length units in Gecko_CSSValue_SetAbsoluteLength. r=emilio --- layout/style/ServoBindings.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/layout/style/ServoBindings.cpp b/layout/style/ServoBindings.cpp index 5d0e472fad40..149cbeeae445 100644 --- a/layout/style/ServoBindings.cpp +++ b/layout/style/ServoBindings.cpp @@ -1091,6 +1091,10 @@ Gecko_NewCSSValueSharedList(uint32_t aLen) void Gecko_CSSValue_SetAbsoluteLength(nsCSSValueBorrowedMut aCSSValue, nscoord aLen) { + MOZ_ASSERT(aCSSValue->GetUnit() == eCSSUnit_Null || aCSSValue->IsLengthUnit()); + // The call below could trigger refcounting if aCSSValue were a + // FontFamilyList, but we just asserted that it's not. So we can + // whitelist this for static analysis. aCSSValue->SetIntegerCoordValue(aLen); }