aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhikari <ftphikari@gmail.com>2022-09-27 11:05:46 +0300
committerhikari <ftphikari@gmail.com>2022-09-27 11:05:46 +0300
commit42144d957b45e29be1da74a98cfaaf465bfc9861 (patch)
tree3bc036079cfba19d53736696c046c46f53492de7 /src
parentd1c778680b8489b3dfcbd20187a1b975e2c71d6d (diff)
parentf50fc33749d550187a41b62f203c33549073fbf3 (diff)
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src')
-rw-r--r--src/llvm_backend_const.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/llvm_backend_const.cpp b/src/llvm_backend_const.cpp
index 6a3b14471..53c7c4dcb 100644
--- a/src/llvm_backend_const.cpp
+++ b/src/llvm_backend_const.cpp
@@ -352,7 +352,7 @@ LLVMValueRef lb_big_int_to_llvm(lbModule *m, Type *original_type, BigInt const *
}
}
- LLVMValueRef value = LLVMConstIntOfArbitraryPrecision(lb_type(m, original_type), cast(unsigned)(sz+7/8), cast(u64 *)rop);
+ LLVMValueRef value = LLVMConstIntOfArbitraryPrecision(lb_type(m, original_type), cast(unsigned)((sz+7)/8), cast(u64 *)rop);
if (big_int_is_neg(a)) {
value = LLVMConstNeg(value);
}
@@ -390,6 +390,9 @@ lbValue lb_const_value(lbModule *m, Type *type, ExactValue value, bool allow_loc
Entity *e = entity_from_expr(expr);
res = lb_find_procedure_value_from_entity(m, e);
}
+ GB_ASSERT(res.value != nullptr);
+ GB_ASSERT(LLVMGetValueKind(res.value) == LLVMFunctionValueKind);
+
res.value = LLVMConstPointerCast(res.value, lb_type(m, res.type));
return res;
}