X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/61933e1667bc5f4853a5bcee425ebc9785a366f0..b24eb750dbfe92c587a1b219702b3bd12efd501b:/sig/parse.cpp diff --git a/sig/parse.cpp b/sig/parse.cpp index 18f0668..57e5a10 100644 --- a/sig/parse.cpp +++ b/sig/parse.cpp @@ -43,7 +43,7 @@ #include "minimal/stdlib.h" -#include +#include #include @@ -164,8 +164,9 @@ struct Type *Parse_(apr_pool_t *pool, const char **name, char eos, bool named, C type->data.data.type = NULL; } else { type->data.data.type = Parse_(pool, name, eos, named, callback); - if (type->data.data.type->primitive == void_P) - type->data.data.type = NULL; + sig::Type *&target(type->data.data.type); + if (target != NULL && target->primitive == void_P) + target = NULL; } break; @@ -277,7 +278,7 @@ const char *Unparse(apr_pool_t *pool, struct Type *type) { return apr_psprintf(pool, "[%lu%s]", type->data.data.size, value); } break; - case pointer_P: return apr_psprintf(pool, "^%s", type->data.data.type == NULL ? "" : Unparse(pool, type->data.data.type)); + case pointer_P: return apr_psprintf(pool, "^%s", type->data.data.type == NULL ? "v" : Unparse(pool, type->data.data.type)); case bit_P: return apr_psprintf(pool, "b%zu", type->data.data.size); case char_P: return "c"; case double_P: return "d";