~sircmpwn/hare unlisted

d8506ff428041663360353360bc98c50f26beeda — Drew DeVault a month ago 6b5e590
gen: fix comparisons with booleans
2 files changed, 4 insertions(+), 4 deletions(-)

M lib/bytes/contains.ha
M src/gen.c
M lib/bytes/contains.ha => lib/bytes/contains.ha +2 -2
@@ 11,6 11,6 @@ export fn contains(b: []u8, v: u8) bool =
@test fn test_contains void =
{
	const input: []u8 = [1: u8, 2: u8, 3: u8, 4: u8];
	assert(contains(input, 1) == true, "inclusive test");
	assert(contains(input, 10) == false, "exclusive test");
	assert(contains(input, 1: u8) == true, "inclusive test");
	assert(contains(input, 10: u8) == false, "exclusive test");
};

M src/gen.c => src/gen.c +2 -2
@@ 1295,10 1295,10 @@ ha_build_ir_expr_bin_arithm(struct ha_qbe_context *context,
					expr->binary_arithm.operator == HA_ARITHM_LAND);
			return;
		}
		bool sign = ha_type_is_numeric(ltype) && ha_type_is_signed(ltype);
		instr.compare.instr = ha_compare_instruction_to_qbe(
				expr->binary_arithm.operator,
				qbe_type_storage_for_type(ltype),
				ha_type_is_signed(ltype));
				qbe_type_storage_for_type(ltype), sign);
		lval = &instr.compare.lvalue, rval = &instr.compare.rvalue;
		out = &instr.compare.out;
	} else {