aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-12-16 22:47:19 -0500
committerAndrew Kelley <andrew@ziglang.org>2019-12-16 22:47:19 -0500
commitb242c2ac103cbb251751dcf94f665e57b9551156 (patch)
treee53806d890b0f672ea10ad6f5216546eed4d9878 /src/ir.cpp
parentb1abe4a1720773e5c33387e6608b192530239552 (diff)
downloadzig-b242c2ac103cbb251751dcf94f665e57b9551156.tar.gz
zig-b242c2ac103cbb251751dcf94f665e57b9551156.zip
avoid using undefined value
closes #3933
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index e126ca9bce..a5dee25645 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -14959,9 +14959,9 @@ static IrInstruction *ir_analyze_bin_op_cmp_numeric(IrAnalyze *ira, IrInstructio
op2_bits += 1;
}
}
- uint32_t dest_int_bits = (op1_bits > op2_bits) ? op1_bits : op2_bits;
ZigType *dest_scalar_type = (dest_float_type == nullptr) ?
- get_int_type(ira->codegen, dest_int_is_signed, dest_int_bits) : dest_float_type;
+ get_int_type(ira->codegen, dest_int_is_signed, (op1_bits > op2_bits) ? op1_bits : op2_bits) :
+ dest_float_type;
ZigType *dest_type = (result_type->id == ZigTypeIdVector) ?
get_vector_type(ira->codegen, result_type->data.vector.len, dest_scalar_type) : dest_scalar_type;