[v1.2.2] Patch the stack explosion on assertion stats cleanup
This commit is contained in:
commit
c4c051be38
5 changed files with 17 additions and 15 deletions
|
@ -1,5 +1,5 @@
|
|||
[bumpversion]
|
||||
current_version = 1.2.1
|
||||
current_version = 1.2.2
|
||||
commit = True
|
||||
|
||||
[bumpversion:file:configure.ac]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
version: 1.2.1_b{build}-{branch}
|
||||
version: 1.2.2_b{build}-{branch}
|
||||
|
||||
os: Windows Server 2012
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
AC_PREREQ([2.60])
|
||||
|
||||
AC_INIT([criterion], [1.2.1], [], [criterion], [franklinmathieu@gmail.com])
|
||||
AC_INIT([criterion], [1.2.2], [], [criterion], [franklinmathieu@gmail.com])
|
||||
AC_CONFIG_SRCDIR([src/runner.c])
|
||||
|
||||
LT_PREREQ([2.2.4])
|
||||
|
|
|
@ -39,7 +39,7 @@ copyright = u'2015, Franklin "Snaipe" Mathieu'
|
|||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
version = '1.2.1'
|
||||
version = '1.2.2'
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = version
|
||||
|
||||
|
|
24
src/stats.c
24
src/stats.c
|
@ -41,7 +41,10 @@ typedef struct criterion_assert_stats s_assert_stats;
|
|||
|
||||
static void destroy_stats(void *ptr, UNUSED void *meta) {
|
||||
s_glob_stats *stats = ptr;
|
||||
sfree(stats->suites);
|
||||
for (s_suite_stats *s = stats->suites, *next; s; s = next) {
|
||||
next = s->next;
|
||||
sfree(s);
|
||||
}
|
||||
}
|
||||
|
||||
s_glob_stats *stats_init(void) {
|
||||
|
@ -50,8 +53,10 @@ s_glob_stats *stats_init(void) {
|
|||
|
||||
static void destroy_suite_stats(void *ptr, UNUSED void *meta) {
|
||||
s_suite_stats *stats = ptr;
|
||||
sfree(stats->tests);
|
||||
sfree(stats->next);
|
||||
for (s_test_stats *t = stats->tests, *next; t; t = next) {
|
||||
next = t->next;
|
||||
sfree(t);
|
||||
}
|
||||
}
|
||||
|
||||
s_suite_stats *suite_stats_init(struct criterion_suite *s) {
|
||||
|
@ -62,8 +67,10 @@ s_suite_stats *suite_stats_init(struct criterion_suite *s) {
|
|||
|
||||
static void destroy_test_stats(void *ptr, UNUSED void *meta) {
|
||||
s_test_stats *stats = ptr;
|
||||
sfree(stats->asserts);
|
||||
sfree(stats->next);
|
||||
for (s_assert_stats *a = stats->asserts, *next; a; a = next) {
|
||||
next = a->next;
|
||||
sfree(a);
|
||||
}
|
||||
}
|
||||
|
||||
s_test_stats *test_stats_init(struct criterion_test *t) {
|
||||
|
@ -128,16 +135,11 @@ static void push_pre_init(s_glob_stats *stats,
|
|||
}
|
||||
}
|
||||
|
||||
static void destroy_assert(void *ptr, UNUSED void *meta) {
|
||||
s_assert_stats *data = ptr;
|
||||
sfree(data->next);
|
||||
}
|
||||
|
||||
static void push_assert(s_glob_stats *stats,
|
||||
s_suite_stats *suite,
|
||||
s_test_stats *test,
|
||||
s_assert_stats *data) {
|
||||
s_assert_stats *dup = unique_ptr(s_assert_stats, (*data), destroy_assert);
|
||||
s_assert_stats *dup = unique_ptr(s_assert_stats, (*data));
|
||||
dup->next = test->asserts;
|
||||
test->asserts = dup;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue