aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend_const.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-08-13 14:16:53 +0100
committergingerBill <bill@gingerbill.org>2021-08-13 14:16:53 +0100
commite6b2df4b2be765cdf96a689a1353af549133d7ad (patch)
treee52d10ea90afed7bcb9e47bc288552979843daac /src/llvm_backend_const.cpp
parenta3930cb470dee93d79a1feb923b9a47a72e1e83a (diff)
Add extra error message check to `lb_big_int_to_llvm`
Diffstat (limited to 'src/llvm_backend_const.cpp')
-rw-r--r--src/llvm_backend_const.cpp4
1 files changed, 4 insertions, 0 deletions
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);