From 8d9cdaaceb14732f7030bcba81601ec1d93b9f57 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Sun, 26 Jul 2020 10:03:59 +0200 Subject: yet another attempt --- test/monniaux/reduced_picosat/reduced_picosat.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test/monniaux/reduced_picosat/reduced_picosat.c (limited to 'test/monniaux/reduced_picosat/reduced_picosat.c') diff --git a/test/monniaux/reduced_picosat/reduced_picosat.c b/test/monniaux/reduced_picosat/reduced_picosat.c new file mode 100644 index 00000000..e1c18438 --- /dev/null +++ b/test/monniaux/reduced_picosat/reduced_picosat.c @@ -0,0 +1,25 @@ +typedef struct b b; +b *a; +struct b { + int c; + int d, **clshead; + int **ahead; + unsigned h; +} i; +b *j(); +int k(); +int main() { + a = j(); + k(a); +} +#define e(f) f - g->c +static void m(b *g, int *l) { + if (g) + *g->ahead = l; +} +b *j() { return &i; } +int k(b *g) { + if (g->d) + m(g, e(g->clshead[-1])); + return g->h; +} -- cgit From aa9060d7309d33a88b95f99e33ff34187b42e832 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Sun, 26 Jul 2020 12:25:32 +0200 Subject: simplified --- test/monniaux/reduced_picosat/reduced_picosat.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'test/monniaux/reduced_picosat/reduced_picosat.c') diff --git a/test/monniaux/reduced_picosat/reduced_picosat.c b/test/monniaux/reduced_picosat/reduced_picosat.c index e1c18438..eb9fdaf8 100644 --- a/test/monniaux/reduced_picosat/reduced_picosat.c +++ b/test/monniaux/reduced_picosat/reduced_picosat.c @@ -5,11 +5,10 @@ struct b { int d, **clshead; int **ahead; unsigned h; -} i; -b *j(); +} glob; int k(); int main() { - a = j(); + a = &glob; k(a); } #define e(f) f - g->c @@ -17,7 +16,6 @@ static void m(b *g, int *l) { if (g) *g->ahead = l; } -b *j() { return &i; } int k(b *g) { if (g->d) m(g, e(g->clshead[-1])); -- cgit