Loading...
--- dyld/dyld-421.2/src/dyldNew.cpp
+++ dyld/dyld-353.2.3/src/dyldNew.cpp
@@ -62,16 +62,12 @@
void* malloc(size_t size)
{
- if ( (dyld::gLibSystemHelpers != NULL) && dyld::gProcessInfo->libSystemInitialized ) {
+ if ( dyld::gLibSystemHelpers != NULL) {
void* p = dyld::gLibSystemHelpers->malloc(size);
//dyld::log("malloc(%lu) => %p from libSystem\n", size, p);
return p;
}
else {
- if ( size > DYLD_POOL_CHUNK_SIZE ) {
- dyld::log("dyld malloc overflow: size=%zu\n", size);
- exit(1);
- }
size = (size+sizeof(void*)-1) & (-sizeof(void*)); // pointer align
uint8_t* result = currentPool->current;
currentPool->current += size;
@@ -132,13 +128,7 @@
return result;
}
else {
- // Check for overflow of integer multiplication
- size_t total = count * size;
- if ( total/count != size ) {
- dyld::log("dyld calloc overflow: count=%zu, size=%zu\n", count, size);
- exit(1);
- }
- return malloc(total);
+ return malloc(count*size);
}
}