2019-06-27 13:45:24 +00:00
|
|
|
#include "unity.h"
|
|
|
|
|
|
|
|
#if CONFIG_COMPILER_STACK_CHECK
|
|
|
|
|
2019-08-06 08:36:16 +00:00
|
|
|
static void recur_and_smash_cxx(void)
|
2019-06-27 13:45:24 +00:00
|
|
|
{
|
|
|
|
static int cnt;
|
|
|
|
volatile uint8_t buf[50];
|
|
|
|
volatile int num = sizeof(buf)+10;
|
|
|
|
|
|
|
|
if (cnt++ < 1) {
|
|
|
|
recur_and_smash_cxx();
|
|
|
|
}
|
|
|
|
for (int i = 0; i < num; i++) {
|
|
|
|
buf[i] = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TEST_CASE("stack smashing protection CXX", "[stack_check] [ignore]")
|
|
|
|
{
|
|
|
|
recur_and_smash_cxx();
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|