X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Falloca.c;h=55a80677f78b85d223cf96436a08af52b667fdf2;hb=fac1a01e39ca1cddd2dd5d5d672136e3d78c766b;hp=10e5d65f01945193ae63b532c60a39278654c514;hpb=f629cb35ff2a467084745d8e635e41eb1f39f6d8;p=gnulib.git diff --git a/lib/alloca.c b/lib/alloca.c index 10e5d65f0..55a80677f 100644 --- a/lib/alloca.c +++ b/lib/alloca.c @@ -25,6 +25,13 @@ # include #endif +#if HAVE_STRING_H +# include +#endif +#if HAVE_STDLIB_H +# include +#endif + #ifdef emacs # include "blockinput.h" #endif @@ -161,8 +168,7 @@ static header *last_alloca_header = NULL; /* -> last alloca header. */ implementations of C, for example under Gould's UTX/32. */ pointer -alloca (size) - unsigned size; +alloca (unsigned size) { auto char probe; /* Probes stack depth: */ register char *depth = ADDRESS_FUNCTION (probe); @@ -211,6 +217,9 @@ alloca (size) register pointer new = malloc (sizeof (header) + size); /* Address of header. */ + if (new == 0) + abort(); + ((header *) new)->h.next = last_alloca_header; ((header *) new)->h.deep = depth;