diff --git a/src/codegen.cpp b/src/codegen.cpp index 2264b08191fc409de559717f5a3ba1b291864f06..a69f9e30b84c1c44f2563532d7685f970956029e 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, "");