~sircmpwn/harec

60a26e3888a53201d07a66766ee6cf513c5ddd9e — Sebastian 2 months ago 9961981
check: add type_dealias to casecmp assert

Verifies that, if two types are aliases, they're aliases of the same
underlying type. This makes sense since, within the function, the
storage of the dealiased types is what's checked.

Signed-off-by: Sebastian <sebastian@sebsite.pw>
1 files changed, 2 insertions(+), 1 deletions(-)

M src/check.c
M src/check.c => src/check.c +2 -1
@@ 2889,7 2889,8 @@ casecmp(const void *_a, const void *_b)
	} else if (b->result->storage == STORAGE_ERROR) {
		return -1;
	}
	assert(a->result->storage == b->result->storage);
	assert(type_dealias(NULL, a->result)->storage
		== type_dealias(NULL, b->result)->storage);
	if (type_is_signed(NULL, a->result)) {
		return a->constant.ival < b->constant.ival ? -1
			: a->constant.ival > b->constant.ival ? 1 : 0;