On 1 Jul 2015 19:36, "Rich Felker" <dal...@libc.org> wrote:
>
> On Wed, Jul 01, 2015 at 04:46:18PM +0100, Ron Yorston wrote:
> > Now that the only thing protected by setjmp/longjmp is the saved string,
> > we can allocate it on the stack to get rid of the jump.
> >
> > Based on commit bd35d8e from git://
git.kernel.org/pub/scm/utils/dash/dash.git
> > by Herbert Xu.
>
> In general alloca is unsafe. It's not obvious to me what the code here
> is doing, so I can't tell for sure if it's safe or not, but I think
> this needs a strong justification of safety before being acceptable.

If you are allocating small amounts of memory then allocated is as safe as
calling a function - i.e. marginally increases the chance of stack overflow
by moving the stack pointer closer to it's limit.

Compare the size of the allocated to the saving of not needing the other
stack based variables, including jmploc.

Sam
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to