Commits

Anonymous committed f63b7f8 Draft

Bug 793880 - Fix the assertion in nsCSSSelector::SetPseudoType to shut up the compiler warning; r=dholbert

Comments (0)

Files changed (1)

layout/style/StyleRule.h

     return static_cast<nsCSSPseudoElements::Type>(mPseudoType);
   }
   void SetPseudoType(nsCSSPseudoElements::Type aType) {
-    NS_ASSERTION(aType > INT16_MIN && aType < INT16_MAX, "Out of bounds");
+    NS_ASSERTION(static_cast<int32_t>(aType) >= INT16_MIN &&
+                 static_cast<int32_t>(aType) <= INT16_MAX,
+                 "Out of bounds - this will overflow mPseudoType");
     mPseudoType = static_cast<int16_t>(aType);
   }