aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-03-11 01:49:56 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-03-11 03:07:26 +0100
commit7f9145f334c94fa29f4911b5a9d6d83538181f4f (patch)
tree8b20eae3f033195991da72af912f69e8efcca721
parentd909cdf88a3f97ec27f8232fc37741d3c7364a32 (diff)
downloadsparse-dev-7f9145f334c94fa29f4911b5a9d6d83538181f4f.tar.gz
llvm: fix typo for constant addresses
Non-null pointers were discarded and a NULL pointer was used instead. Fix this by adding the missing 'else'. Fixes: 18434703507423b58ecefe941438755525ec834a Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-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);