aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/codegen.cpp')
-rw-r--r--src/codegen.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp
index 2264b08191..a69f9e30b8 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -542,8 +542,11 @@ static LLVMValueRef gen_arithmetic_bin_op(CodeGen *g, AstNode *source_node,
return LLVMBuildShl(g->builder, val1, val2, "");
case BinOpTypeBitShiftRight:
case BinOpTypeAssignBitShiftRight:
+ assert(op1_type->id == TypeTableEntryIdInt);
+ assert(op2_type->id == TypeTableEntryIdInt);
+
add_debug_source_node(g, source_node);
- if (op1_type->id == TypeTableEntryIdInt) {
+ if (op1_type->data.integral.is_signed) {
return LLVMBuildAShr(g->builder, val1, val2, "");
} else {
return LLVMBuildLShr(g->builder, val1, val2, "");