Message ID | 20170327212416.18536-29-luc.vanoostenryck@gmail.com (mailing list archive) |
---|---|
State | Mainlined, archived |
Headers | show |
diff --git a/sparse-llvm.c b/sparse-llvm.c index 7978579f3..31411d9d1 100644 --- a/sparse-llvm.c +++ b/sparse-llvm.c @@ -771,7 +771,7 @@ static void output_op_switch(struct function *fn, struct instruction *insn) FOR_EACH_PTR(insn->multijmp_list, jmp) { if (jmp->begin == jmp->end) { /* case N */ LLVMAddCase(target, - LLVMConstInt(LLVMInt32Type(), jmp->begin, 0), + val_to_value(jmp->begin, insn->type), jmp->target->priv); } else if (jmp->begin < jmp->end) { /* case M..N */ assert(0);
In sparse-llvm, the type of switch constants are hardcoded to 'i32'. Fix this by using the right type as given by the instruction. Reported-by: Dibyendu Majumdar <mobile@majumdar.org.uk> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> --- sparse-llvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)