]> git.saurik.com Git - cycript.git/blobdiff - sig/parse.cpp
Found the garbage collection bug from hell (classes apparently really need /something...
[cycript.git] / sig / parse.cpp
index 18f0668f4e094d50c8a4964248790f74adef52d5..57e5a10669b166aae90e027b51167c516a30b35a 100644 (file)
@@ -43,7 +43,7 @@
 
 #include "minimal/stdlib.h"
 
-#include <apr-1/apr_strings.h>
+#include <apr_strings.h>
 
 #include <string.h>
 
@@ -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";