if ! cmp -s .tmp.want .tmp.have; then \
echo "FAILED"; diff -u .tmp.want .tmp.have ; exit 1; fi ;\
echo -n "passed ... "; \
- if ! valgrind ./oceani --section "test: $$t" oceani-tests.mdc $${1+"$$@"} \
- > /dev/null 2> .tmp.valg; then \
+ if ! valgrind --error-exitcode=1 --log-file=.tmp.valg ./oceani --section "test: $$t" oceani-tests.mdc $${1+"$$@"} \
+ > /dev/null 2>&1 ; then \
echo "valgrind FAILED"; cat .tmp.valg; exit 1; fi ; \
+ if grep 'LEAK SUMMARY' .tmp.valg > /dev/null; then \
+ echo "valgrind found LEAKS"; cat .tmp.valg ; exit 1 ; fi; \
+ if grep 'in use at exit [1-9]' .tmp.valg > /dev/null; then \
+ echo "valgrind found memory in use at exit"; cat .tmp.valg ; exit 1 ; fi; \
echo -n "valgrind passed ... "; \
echo '``````' > .tmp.code1; echo '``````' > .tmp.code2 ;\
./oceani --noexec --print --section "test: $$t" oceani-tests.mdc >> .tmp.code1; \
$0->array.member = $<4;
$0->array.vsize = NULL;
{
+ struct parse_context *c = config2context(config);
char tail[3];
mpq_t num;
if (number_parse(num, tail, $2.txt) == 0)
- tok_err(config2context(config), "error: unrecognised number", &$2);
+ tok_err(c, "error: unrecognised number", &$2);
else if (tail[0])
- tok_err(config2context(config), "error: unsupported number suffix", &$2);
+ tok_err(c, "error: unsupported number suffix", &$2);
else {
$0->array.size = mpz_get_ui(mpq_numref(num));
if (mpz_cmp_ui(mpq_denref(num), 1) != 0) {
- tok_err(config2context(config), "error: array size must be an integer",
+ tok_err(c, "error: array size must be an integer",
&$2);
} else if (mpz_cmp_ui(mpq_numref(num), 1UL << 30) >= 0)
- tok_err(config2context(config), "error: array size is too large",
+ tok_err(c, "error: array size is too large",
&$2);
+ mpq_clear(num);
}
+ $0->next= c->anon_typelist;
+ c->anon_typelist = $0;
}
}$
| [ IDENTIFIER ] Type ${ {
- struct variable *v = var_ref(config2context(config), $2.txt);
+ struct parse_context *c = config2context(config);
+ struct variable *v = var_ref(c, $2.txt);
if (!v)
tok_err(config2context(config), "error: name undeclared", &$2);
$0->array.member = $<4;
$0->array.size = 0;
$0->array.vsize = v;
+ $0->next= c->anon_typelist;
+ c->anon_typelist = $0;
} }$
+###### parse context
+
+ struct type *anon_typelist;
+
+###### free context types
+
+ while (context.anon_typelist) {
+ struct type *t = context.anon_typelist;
+
+ context.anon_typelist = t->next;
+ free(t);
+ }
+
###### Binode types
Index,