Commit 6fc673d64500db41be492c6942b2b6324ec3e633

Daniel Mendler 2019-05-12T15:52:32

statically check MP_PREC >= MP_MIN_PREC

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/bn_mp_shrink.c b/bn_mp_shrink.c
index fec5841..28754f5 100644
--- a/bn_mp_shrink.c
+++ b/bn_mp_shrink.c
@@ -6,8 +6,10 @@
 /* shrink a bignum */
 int mp_shrink(mp_int *a)
 {
+   static int static_check[-(MP_PREC < MP_MIN_PREC)];
    mp_digit *tmp;
    int alloc = MP_MAX(MP_MIN_PREC, a->used);
+   (void)static_check;
    if (a->alloc != alloc) {
       if ((tmp = (mp_digit *) MP_REALLOC(a->dp,
                                          (size_t)a->alloc * sizeof(mp_digit),