From c4fb5e261e9f928105f9259c0d1d55e657c49dc4 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Fri, 10 Jan 2014 00:04:21 -0800 Subject: [PATCH] Filter chosen objects to those of the right size. --- ObjectiveC/Library.mm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ObjectiveC/Library.mm b/ObjectiveC/Library.mm index 9a7ab86..7b0785a 100644 --- a/ObjectiveC/Library.mm +++ b/ObjectiveC/Library.mm @@ -2241,9 +2241,13 @@ static void choose_(task_t task, void *baton, unsigned type, vm_range_t *ranges, Class isa(reinterpret_cast(pointers[0])); #endif - if (choice->query_.find(isa) == choice->query_.end()) + std::set::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(data))); } } -- 2.45.2