]> Pileus Git - ~andy/gtk/commitdiff
Fix cnp bug in _gtk_bitmask_intersects
authorAlexander Larsson <alexl@redhat.com>
Fri, 9 Nov 2012 08:05:47 +0000 (09:05 +0100)
committerAlexander Larsson <alexl@redhat.com>
Fri, 9 Nov 2012 09:11:47 +0000 (10:11 +0100)
We need to use the allocated codepath if *any* argument is
allocated, not if one arg is not allocated.
This bug caused unnecessary calls to _gtk_bitmask_is_allocated,
as well as return completely wrong result if both bitmask are
allocated.

gtk/gtkbitmaskprivateimpl.h

index 0dea65abe79843a4e05debcd7cc8940df23955f5..c46fa9622ce389509ad38476fcef6641ececa615 100644 (file)
@@ -159,8 +159,8 @@ static inline gboolean
 _gtk_bitmask_intersects (const GtkBitmask *mask,
                          const GtkBitmask *other)
 {
-  if (!_gtk_bitmask_is_allocated (mask) ||
-      !_gtk_bitmask_is_allocated (other))
+  if (_gtk_bitmask_is_allocated (mask) ||
+      _gtk_bitmask_is_allocated (other))
     return _gtk_allocated_bitmask_intersects (mask, other);
   else
     return _gtk_bitmask_to_bits (mask) & _gtk_bitmask_to_bits (other);