~lbnz/xr0

aebfa9ce0f48ddbd83126164a4c2863780129b6f — Xr0 Team a month ago f0b6093 feat/bang-eval
checkpoint
2 files changed, 15 insertions(+), 2 deletions(-)

M src/state/state.c
A tests/0-basic/400-out-of-order-alloc.x
M src/state/state.c => src/state/state.c +7 -2
@@ 104,6 104,11 @@ state_str(struct state *state)
		strbuilder_printf(b, "static:\n%s\n", static_mem);
	}
	free(static_mem);
	if (state->reg) {
		char *ret = value_str(state->reg);
		strbuilder_printf(b, "return: <%s>\n\n", ret);
		free(ret);
	}
	char *vconst = vconst_str(state->vconst, "\t");
	if (strlen(vconst) > 0) {
		strbuilder_printf(b, "rconst:\n%s\n", vconst);


@@ 673,8 678,8 @@ state_equal(struct state *s1, struct state *s2)
	     *str2 = state_str(s2_c);
	bool equal = strcmp(str1, str2) == 0;
	if (!equal) {
		v_printf("abstract: %s", str2);
		v_printf("actual: %s", str1);
		v_printf("abstract:\n%s\n", str2);
		v_printf("actual:\n%s\n", str1);
	}
	free(str2);
	free(str1);

A tests/0-basic/400-out-of-order-alloc.x => tests/0-basic/400-out-of-order-alloc.x +8 -0
@@ 0,0 1,8 @@
#include <stdlib.h>

void
f() ~ [ return malloc(1); ]
{
	free(malloc(1));
	return malloc(1);
}