sparse-llvm incorrect handling of op_add when pointers are involved

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

I am starting a new thread for this issue. The handling of op_add does
not work correctly when an operand is a pointer type. A potential fix
might be:

case OP_ADD:
if (symbol_is_fp_type(C, insn->type))
target = LLVMBuildFAdd(fn->builder, lhs, rhs, target_name);
else {
if (LLVMGetTypeKind(LLVMTypeOf(lhs)) == LLVMPointerTypeKind) {
target = LLVMBuildGEP(fn->builder, lhs, &rhs, 1, "");
}
else if (LLVMGetTypeKind(LLVMTypeOf(rhs)) == LLVMPointerTypeKind) {
target = LLVMBuildGEP(fn->builder, rhs, &lhs, 1, "");
}
else {
target = LLVMBuildAdd(fn->builder, lhs, rhs, target_name);
}
}
break;

Thanks and Regards
Dibyendu
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux