Re: [PATCH] Fix max-stack calculators to skip canary

From: Eric Sandeen
Date: Tue Apr 22 2008 - 14:09:30 EST


Joe Perches wrote:

> Wouldn't it be better to have exactly the same code?
> How about using a statement expression macro?
>
> #define DEBUG_STACK_FREE(process) \
> ({ \
> unsigned long *n = end_of_stack(process); \
> do { /* Skip over canary */\
> n++; \
> } while (!*n); \
> (unsigned long)n - (unsigned long)end_of_stack(process); \
> })
>

That'd probably be good although I don't think we like macros anymore :)

-Eric
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/