From 4f63b59016d6952f0ddf408a3b1be97f10febc13 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sat, 27 Aug 2016 00:50:40 -0700 Subject: Add guarantee that allocations shouldn't overflow. --- ldid.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ldid.cpp') diff --git a/ldid.cpp b/ldid.cpp index 0c70b40..a4dc725 100644 --- 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_; } } -- cgit v1.2.3-56-ge451