aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/sparse-llvm.c
diff options
Diffstat (limited to 'sparse-llvm.c')
-rw-r--r--sparse-llvm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sparse-llvm.c b/sparse-llvm.c
index b34decda..b22d2f67 100644
--- a/sparse-llvm.c
+++ b/sparse-llvm.c
@@ -330,8 +330,9 @@ static LLVMValueRef constant_value(unsigned long long val, LLVMTypeRef dtype)
LLVMTypeRef itype = LLVMIntType(bits_in_pointer);
result = LLVMConstInt(itype, val, 1);
result = LLVMConstIntToPtr(result, dtype);
+ } else {
+ result = LLVMConstPointerNull(dtype);
}
- result = LLVMConstPointerNull(dtype);
break;
case LLVMIntegerTypeKind:
result = LLVMConstInt(dtype, val, 1);