Ver código fonte

LibWeb: VERIFY that nobody tries to hash a non-finite CSSPixels value

Non-finite CSSPixels quantities should never make their way into hash
tables. If this ever happens, let's catch it closer to the source
instead of letting things cascade into confusion.
Andreas Kling 2 anos atrás
pai
commit
134717ec8f
1 arquivos alterados com 1 adições e 0 exclusões
  1. 1 0
      Userland/Libraries/LibWeb/PixelUnits.h

+ 1 - 0
Userland/Libraries/LibWeb/PixelUnits.h

@@ -127,6 +127,7 @@ template<>
 struct Traits<Web::CSSPixels> : public GenericTraits<Web::CSSPixels> {
     static unsigned hash(Web::CSSPixels const& key)
     {
+        VERIFY(isfinite(key.value()));
         return Traits<Web::CSSPixels::Type>::hash(key.value());
     }