]> git.saurik.com Git - cycript.git/commitdiff
Filter chosen objects to those of the right size.
authorJay Freeman (saurik) <saurik@saurik.com>
Fri, 10 Jan 2014 08:04:21 +0000 (00:04 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Fri, 10 Jan 2014 08:04:21 +0000 (00:04 -0800)
ObjectiveC/Library.mm

index 9a7ab86c08e297c9b4d73814b2c7e59bda515fc6..7b0785ad6b4de079eef39b38282f06db85f8d2f8 100644 (file)
@@ -2241,9 +2241,13 @@ static void choose_(task_t task, void *baton, unsigned type, vm_range_t *ranges,
         Class isa(reinterpret_cast<Class>(pointers[0]));
 #endif
 
-        if (choice->query_.find(isa) == choice->query_.end())
+        std::set<Class>::const_iterator result(choice->query_.find(isa));
+        if (result == choice->query_.end())
             continue;
 
+        // XXX: if (size < class_getInstanceSize(*result))
+        if ((class_getInstanceSize(*result) + 15) / 16 * 16 != size)
+            continue;
         CYArrayPush(context, choice->results_, CYCastJSValue(context, reinterpret_cast<id>(data)));
     }
 }