]> git.saurik.com Git - ldid.git/commitdiff
Add guarantee that allocations shouldn't overflow.
authorJay Freeman (saurik) <saurik@saurik.com>
Sat, 27 Aug 2016 07:50:40 +0000 (00:50 -0700)
committerJay Freeman (saurik) <saurik@saurik.com>
Sat, 27 Aug 2016 07:50:40 +0000 (00:50 -0700)
ldid.cpp

index 0c70b40352fc78b38a9239ffaff77b3074306c0e..a4dc725b73714ea99a7f0d94e9059001b235c884 100644 (file)
--- a/ldid.cpp
+++ b/ldid.cpp
@@ -1171,6 +1171,8 @@ static void Allocate(const void *idata, size_t isize, std::streambuf &output, co
         size_t saved(save(mach_header, output, allocation.limit_, overlap, top));
         if (allocation.alloc_ > saved)
             pad(output, allocation.alloc_ - saved);
+        else
+            _assert(allocation.alloc_ == saved);
         position += allocation.alloc_;
     }
 }