From f50fc33749d550187a41b62f203c33549073fbf3 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Thu, 15 Sep 2022 10:00:50 +0100 Subject: Clean up of the core library to make the stream vtables not be pointers directly. --- src/llvm_backend_const.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/llvm_backend_const.cpp') diff --git a/src/llvm_backend_const.cpp b/src/llvm_backend_const.cpp index 45e597a9e..53c7c4dcb 100644 --- a/src/llvm_backend_const.cpp +++ b/src/llvm_backend_const.cpp @@ -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; } -- cgit v1.2.3