X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/c1d3e52e58e86c49f9d04e06ae8e0ece4b98250c..d3865d294299f1d5404b59f4482ebb116c8fcee0:/Decode.cpp?ds=sidebyside diff --git a/Decode.cpp b/Decode.cpp index 95f68ef..e7ea5f9 100644 --- a/Decode.cpp +++ b/Decode.cpp @@ -88,8 +88,16 @@ CYTypedIdentifier *Decode_(CYPool &pool, struct sig::Type *type) { case sig::void_P: return $ CYTypedIdentifier($ CYTypeVoid()); case sig::struct_P: { - _assert(type->name != NULL); - return $ CYTypedIdentifier($ CYTypeVariable(type->name)); + CYTypeStructField *fields(NULL); + for (size_t i(type->data.signature.count); i != 0; --i) { + sig::Element &element(type->data.signature.elements[i - 1]); + CYTypedIdentifier *typed(Decode(pool, element.type)); + if (element.name != NULL) + typed->identifier_ = $I(element.name); + fields = $ CYTypeStructField(typed, fields); + } + CYIdentifier *name(type->name == NULL ? NULL : $I(type->name)); + return $ CYTypedIdentifier($ CYTypeStruct(name, fields)); } break; }