From: Jay Freeman (saurik) Date: Tue, 20 Oct 2009 04:57:15 +0000 (+0000) Subject: Fixed an occasional crash bug in sig::Type copying. X-Git-Tag: v0.9.432~308 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/2699b547ffcc98e382983f63939f6164c424cfce?ds=sidebyside Fixed an occasional crash bug in sig::Type copying. --- diff --git a/Library.mm b/Library.mm index a7da81e..e4bf70b 100644 --- a/Library.mm +++ b/Library.mm @@ -469,9 +469,14 @@ void Copy(apr_pool_t *pool, Type &lhs, Type &rhs) { if (sig::IsAggregate(rhs.primitive)) Copy(pool, lhs.data.signature, rhs.data.signature); else { - if (rhs.data.data.type != NULL) { - lhs.data.data.type = new(pool) Type; - Copy(pool, *lhs.data.data.type, *rhs.data.data.type); + sig::Type *&lht(lhs.data.data.type); + sig::Type *&rht(rhs.data.data.type); + + if (rht == NULL) + lht = NULL; + else { + lht = new(pool) Type; + Copy(pool, *lht, *rht); } lhs.data.data.size = rhs.data.data.size;