Browse Source

Convert constant tag to the correct type for LLVMAddCase

gingerBill 4 years ago
parent
commit
adb25d9d19
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/llvm_backend.cpp

+ 1 - 0
src/llvm_backend.cpp

@@ -4909,6 +4909,7 @@ void lb_build_switch_stmt(lbProcedure *p, AstSwitchStmt *ss, Scope *scope) {
 					GB_ASSERT(!is_ast_range(expr));
 
 					on_val = lb_build_expr(p, expr);
+					on_val = lb_emit_conv(p, on_val, tag.type);
 				}
 
 				GB_ASSERT(LLVMIsConstant(on_val.value));