From 81b00c7a3e26b5faf8f149d45c1e63ed431ab2c6 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sun, 23 Feb 2020 10:11:43 +0000 Subject: Fix #563 --- src/ir.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/ir.cpp') diff --git a/src/ir.cpp b/src/ir.cpp index 2f4d491e7..f28179472 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -7376,10 +7376,11 @@ irValue *ir_build_expr_internal(irProcedure *proc, Ast *expr) { GB_ASSERT(are_types_identical(ir_type(left), key_type)); Type *it = bit_set_to_int(rt); + left = ir_emit_conv(proc, left, it); irValue *lower = ir_value_constant(it, exact_value_i64(rt->BitSet.lower)); - irValue *key = ir_emit_arith(proc, Token_Sub, left, lower, ir_type(left)); - irValue *bit = ir_emit_arith(proc, Token_Shl, v_one, key, ir_type(left)); + irValue *key = ir_emit_arith(proc, Token_Sub, left, lower, it); + irValue *bit = ir_emit_arith(proc, Token_Shl, v_one, key, it); bit = ir_emit_conv(proc, bit, it); irValue *old_value = ir_emit_bitcast(proc, right, it); -- cgit v1.2.3 From a72ac6f84140f3cb5f5ed790ec76182efa4f959a Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sun, 23 Feb 2020 10:26:49 +0000 Subject: Fix #572 --- src/ir.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ir.cpp') diff --git a/src/ir.cpp b/src/ir.cpp index f28179472..b171e8589 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -5714,7 +5714,7 @@ irValue *ir_emit_transmute(irProcedure *proc, irValue *value, Type *t) { } // TODO(bill): Actually figure out what the conversion needs to be correctly 'cause LLVM - return ir_emit_bitcast(proc, value, dst); + return ir_emit_bitcast(proc, value, t); } -- cgit v1.2.3