X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/03db6a67c728f631b6c6f6fd140eb86a8050cf12..f6fa3c2112ee8b0aa26ab0765674601a9800db77:/Decode.cpp?ds=sidebyside diff --git a/Decode.cpp b/Decode.cpp index dd2bc02..bdef46b 100644 --- a/Decode.cpp +++ b/Decode.cpp @@ -42,11 +42,14 @@ CYTypedIdentifier *Decode_(CYPool &pool, struct sig::Type *type) { case sig::selector_P: return $ CYTypedIdentifier($ CYTypeVariable("SEL")); case sig::block_P: { - _assert(type->data.signature.count != 0); - CYTypedParameter *parameter(NULL); - for (size_t i(type->data.signature.count - 1); i != 0; --i) - parameter = $ CYTypedParameter(Decode(pool, type->data.signature.elements[i].type), parameter); - return Decode(pool, type->data.signature.elements[0].type)->Modify($ CYTypeBlockWith(parameter)); + if (type->data.signature.count == 0) + return $ CYTypedIdentifier($ CYTypeVariable("NSBlock"), $ CYTypePointerTo()); + else { + CYTypedParameter *parameter(NULL); + for (size_t i(type->data.signature.count - 1); i != 0; --i) + parameter = $ CYTypedParameter(Decode(pool, type->data.signature.elements[i].type), parameter); + return Decode(pool, type->data.signature.elements[0].type)->Modify($ CYTypeBlockWith(parameter)); + } } break; case sig::object_P: {