Re: malloc was optimized out
Re: malloc was optimized out
- Subject: Re: malloc was optimized out
- From: Jens Alfke <email@hidden>
- Date: Mon, 04 Jul 2016 23:36:42 -0700
On Jul 4, 2016, at 11:25 PM, Dmitry Markman < email@hidden> wrote:
what was confusing that debug build isn’t failing, only release build of our library crashes application
Does the real application make malloc calls of “ridiculous” sizes where malloc returns NULL? In that case the crash in the release build might have been because Clang decided to optimize away your tests for a NULL return value. In that case Clang’s optimizer is being wrong, but it’s probably best for you to preflight the size yourself and give up before calling malloc if the size is that big.
—Jens |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden