diff options
-rw-r--r-- | polly/include/polly/Support/GICHelper.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/polly/include/polly/Support/GICHelper.h b/polly/include/polly/Support/GICHelper.h index b968ece659f..53c13e04e3f 100644 --- a/polly/include/polly/Support/GICHelper.h +++ b/polly/include/polly/Support/GICHelper.h @@ -260,10 +260,14 @@ public: That.Obj = nullptr; } /* implicit */ IslPtr(NonowningIslPtr<T> That) : IslPtr(That.copy(), true) {} - ~IslPtr() { Traits::free(Obj); } + ~IslPtr() { + if (Obj) + Traits::free(Obj); + } ThisTy &operator=(const ThisTy &That) { - Traits::free(this->Obj); + if (Obj) + Traits::free(Obj); this->Obj = Traits::copy(That.Obj); return *this; } |