From e6b2df4b2be765cdf96a689a1353af549133d7ad Mon Sep 17 00:00:00 2001 From: gingerBill Date: Fri, 13 Aug 2021 14:16:53 +0100 Subject: [PATCH] Add extra error message check to `lb_big_int_to_llvm` --- src/llvm_backend_const.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/llvm_backend_const.cpp b/src/llvm_backend_const.cpp index 0062a8be1..f05202e79 100644 --- a/src/llvm_backend_const.cpp +++ b/src/llvm_backend_const.cpp @@ -296,6 +296,10 @@ LLVMValueRef lb_big_int_to_llvm(lbModule *m, Type *original_type, BigInt const * mp_endian endian = MP_LITTLE_ENDIAN; max_count = mp_pack_count(a, nails, size); + if (sz < max_count) { + debug_print_big_int(a); + gb_printf_err("%s -> %tu\n", type_to_string(original_type), sz);; + } GB_ASSERT_MSG(sz >= max_count, "max_count: %tu, sz: %tu, written: %tu", max_count, sz, written); GB_ASSERT(gb_size_of(rop64) >= sz);