crypto/bio/b_print.c:662: error: INTEGER_OVERFLOW_L2
  ([min(1, `fvalue`), 18446744073709551615] + 1):unsigned64.
Showing all 9 steps of the trace


crypto/bio/b_print.c:546:1: <LHS trace>
544.   }
545.   
546. > static int
547.   fmtfp(char **sbuffer,
548.         char **buffer,

crypto/bio/b_print.c:546:1: Parameter `fvalue`
544.   }
545.   
546. > static int
547.   fmtfp(char **sbuffer,
548.         char **buffer,

crypto/bio/b_print.c:640:15: Call
638.               fvalue = tmpvalue;
639.       }
640.       ufvalue = abs_val(fvalue);
                     ^
641.       if (ufvalue > ULONG_MAX) {
642.           /* Number too big */

crypto/bio/b_print.c:518:1: Parameter `value`
  516.   }
  517.   
  518. > static LDOUBLE abs_val(LDOUBLE value)
  519.   {
  520.       LDOUBLE result = value;

crypto/bio/b_print.c:520:5: Assignment
  518.   static LDOUBLE abs_val(LDOUBLE value)
  519.   {
  520.       LDOUBLE result = value;
             ^
  521.       if (value < 0)
  522.           result = -value;

crypto/bio/b_print.c:523:5: Assignment
  521.       if (value < 0)
  522.           result = -value;
  523.       return result;
             ^
  524.   }
  525.   

crypto/bio/b_print.c:640:5: Assignment
638.               fvalue = tmpvalue;
639.       }
640.       ufvalue = abs_val(fvalue);
           ^
641.       if (ufvalue > ULONG_MAX) {
642.           /* Number too big */

crypto/bio/b_print.c:645:5: Assignment
643.           return 0;
644.       }
645.       intpart = (unsigned long)ufvalue;
           ^
646.   
647.       /*

crypto/bio/b_print.c:662:9: Binary operation: ([min(1, fvalue), 18446744073709551615] + 1):unsigned64
660.   
661.       if (fracpart >= max10) {
662.           intpart++;
               ^
663.           fracpart -= max10;
664.       }

static int
fmtfp(char **sbuffer,
      char **buffer,
      size_t *currlen,
      size_t *maxlen, LDOUBLE fvalue, int min, int max, int flags, int style)
{
    int signvalue = 0;
    LDOUBLE ufvalue;
    LDOUBLE tmpvalue;
    char iconvert[20];
    char fconvert[20];
    char econvert[20];
    int iplace = 0;
    int fplace = 0;
    int eplace = 0;
    int padlen = 0;
    int zpadlen = 0;
    long exp = 0;
    unsigned long intpart;
    unsigned long fracpart;
    unsigned long max10;
    int realstyle;
    if (max < 0)
        max = 6;
    if (fvalue < 0)
        signvalue = '-';
    else if (flags & DP_F_PLUS)
        signvalue = '+';
    else if (flags & DP_F_SPACE)
        signvalue = ' ';
    if (style == G_FORMAT) {
        if (fvalue == 0.0) {
            realstyle = F_FORMAT;
        } else if (fvalue < 0.0001) {
            realstyle = E_FORMAT;
        } else if ((max == 0 && fvalue >= 10)
                    || (max > 0 && fvalue >= pow_10(max))) {
            realstyle = E_FORMAT;
        } else {
            realstyle = F_FORMAT;
        }
    } else {
        realstyle = style;
    }
    if (style != F_FORMAT) {
        tmpvalue = fvalue;
        if (fvalue != 0.0) {
            while (tmpvalue < 1) {
                tmpvalue *= 10;
                exp--;
            }
            while (tmpvalue > 10) {
                tmpvalue /= 10;
                exp++;
            }
        }
        if (style == G_FORMAT) {
            if (max == 0)
                max = 1;
            if (realstyle == F_FORMAT) {
                max -= (exp + 1);
                if (max < 0) {
                    return 0;
                }
            } else {
                max--;
            }
        }
        if (realstyle == E_FORMAT)
            fvalue = tmpvalue;
    }
    ufvalue = abs_val(fvalue);
    if (ufvalue > ULONG_MAX) {
        return 0;
    }
    intpart = (unsigned long)ufvalue;
    if (max > 9)
        max = 9;
    max10 = roundv(pow_10(max));
    fracpart = roundv(pow_10(max) * (ufvalue - intpart));
    if (fracpart >= max10) {
        intpart++;
        fracpart -= max10;
    }
    do {
        iconvert[iplace++] = "0123456789"[intpart % 10];
        intpart = (intpart / 10);
    } while (intpart && (iplace < (int)sizeof(iconvert)));
    if (iplace == sizeof iconvert)
        iplace--;
    iconvert[iplace] = 0;
    while (fplace < max) {
        if (style == G_FORMAT && fplace == 0 && (fracpart % 10) == 0) {
            max--;
            fracpart = fracpart / 10;
            if (fplace < max)
                continue;
            break;
        }
        fconvert[fplace++] = "0123456789"[fracpart % 10];
        fracpart = (fracpart / 10);
    }
    if (fplace == sizeof fconvert)
        fplace--;
    fconvert[fplace] = 0;
    if (realstyle == E_FORMAT) {
        int tmpexp;
        if (exp < 0)
            tmpexp = -exp;
        else
            tmpexp = exp;
        do {
            econvert[eplace++] = "0123456789"[tmpexp % 10];
            tmpexp = (tmpexp / 10);
        } while (tmpexp > 0 && eplace < (int)sizeof(econvert));
        if (tmpexp > 0)
            return 0;
        if (eplace == 1)
            econvert[eplace++] = '0';
    }
    padlen = min - iplace - max - (max > 0 ? 1 : 0) - ((signvalue) ? 1 : 0);
    if (realstyle == E_FORMAT)
        padlen -= 2 + eplace;
    zpadlen = max - fplace;
    if (zpadlen < 0)
        zpadlen = 0;
    if (padlen < 0)
        padlen = 0;
    if (flags & DP_F_MINUS)
        padlen = -padlen;
    if ((flags & DP_F_ZERO) && (padlen > 0)) {
        if (signvalue) {
            if (!doapr_outch(sbuffer, buffer, currlen, maxlen, signvalue))
                return 0;
            --padlen;
            signvalue = 0;
        }
        while (padlen > 0) {
            if (!doapr_outch(sbuffer, buffer, currlen, maxlen, '0'))
                return 0;
            --padlen;
        }
    }
    while (padlen > 0) {
        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
            return 0;
        --padlen;
    }
    if (signvalue && !doapr_outch(sbuffer, buffer, currlen, maxlen, signvalue))
        return 0;
    while (iplace > 0) {
        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, iconvert[--iplace]))
            return 0;
    }
    if (max > 0 || (flags & DP_F_NUM)) {
        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, '.'))
            return 0;
        while (fplace > 0) {
            if(!doapr_outch(sbuffer, buffer, currlen, maxlen,
                            fconvert[--fplace]))
                return 0;
        }
    }
    while (zpadlen > 0) {
        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, '0'))
            return 0;
        --zpadlen;
    }
    if (realstyle == E_FORMAT) {
        char ech;
        if ((flags & DP_F_UP) == 0)
            ech = 'e';
        else
            ech = 'E';
        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ech))
                return 0;
        if (exp < 0) {
            if (!doapr_outch(sbuffer, buffer, currlen, maxlen, '-'))
                    return 0;
        } else {
            if (!doapr_outch(sbuffer, buffer, currlen, maxlen, '+'))
                    return 0;
        }
        while (eplace > 0) {
            if (!doapr_outch(sbuffer, buffer, currlen, maxlen,
                             econvert[--eplace]))
                return 0;
        }
    }
    while (padlen < 0) {
        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
            return 0;
        ++padlen;
    }
    return 1;
}
['static int\nfmtfp(char **sbuffer,\n      char **buffer,\n      size_t *currlen,\n      size_t *maxlen, LDOUBLE fvalue, int min, int max, int flags, int style)\n{\n    int signvalue = 0;\n    LDOUBLE ufvalue;\n    LDOUBLE tmpvalue;\n    char iconvert[20];\n    char fconvert[20];\n    char econvert[20];\n    int iplace = 0;\n    int fplace = 0;\n    int eplace = 0;\n    int padlen = 0;\n    int zpadlen = 0;\n    long exp = 0;\n    unsigned long intpart;\n    unsigned long fracpart;\n    unsigned long max10;\n    int realstyle;\n    if (max < 0)\n        max = 6;\n    if (fvalue < 0)\n        signvalue = \'-\';\n    else if (flags & DP_F_PLUS)\n        signvalue = \'+\';\n    else if (flags & DP_F_SPACE)\n        signvalue = \' \';\n    if (style == G_FORMAT) {\n        if (fvalue == 0.0) {\n            realstyle = F_FORMAT;\n        } else if (fvalue < 0.0001) {\n            realstyle = E_FORMAT;\n        } else if ((max == 0 && fvalue >= 10)\n                    || (max > 0 && fvalue >= pow_10(max))) {\n            realstyle = E_FORMAT;\n        } else {\n            realstyle = F_FORMAT;\n        }\n    } else {\n        realstyle = style;\n    }\n    if (style != F_FORMAT) {\n        tmpvalue = fvalue;\n        if (fvalue != 0.0) {\n            while (tmpvalue < 1) {\n                tmpvalue *= 10;\n                exp--;\n            }\n            while (tmpvalue > 10) {\n                tmpvalue /= 10;\n                exp++;\n            }\n        }\n        if (style == G_FORMAT) {\n            if (max == 0)\n                max = 1;\n            if (realstyle == F_FORMAT) {\n                max -= (exp + 1);\n                if (max < 0) {\n                    return 0;\n                }\n            } else {\n                max--;\n            }\n        }\n        if (realstyle == E_FORMAT)\n            fvalue = tmpvalue;\n    }\n    ufvalue = abs_val(fvalue);\n    if (ufvalue > ULONG_MAX) {\n        return 0;\n    }\n    intpart = (unsigned long)ufvalue;\n    if (max > 9)\n        max = 9;\n    max10 = roundv(pow_10(max));\n    fracpart = roundv(pow_10(max) * (ufvalue - intpart));\n    if (fracpart >= max10) {\n        intpart++;\n        fracpart -= max10;\n    }\n    do {\n        iconvert[iplace++] = "0123456789"[intpart % 10];\n        intpart = (intpart / 10);\n    } while (intpart && (iplace < (int)sizeof(iconvert)));\n    if (iplace == sizeof iconvert)\n        iplace--;\n    iconvert[iplace] = 0;\n    while (fplace < max) {\n        if (style == G_FORMAT && fplace == 0 && (fracpart % 10) == 0) {\n            max--;\n            fracpart = fracpart / 10;\n            if (fplace < max)\n                continue;\n            break;\n        }\n        fconvert[fplace++] = "0123456789"[fracpart % 10];\n        fracpart = (fracpart / 10);\n    }\n    if (fplace == sizeof fconvert)\n        fplace--;\n    fconvert[fplace] = 0;\n    if (realstyle == E_FORMAT) {\n        int tmpexp;\n        if (exp < 0)\n            tmpexp = -exp;\n        else\n            tmpexp = exp;\n        do {\n            econvert[eplace++] = "0123456789"[tmpexp % 10];\n            tmpexp = (tmpexp / 10);\n        } while (tmpexp > 0 && eplace < (int)sizeof(econvert));\n        if (tmpexp > 0)\n            return 0;\n        if (eplace == 1)\n            econvert[eplace++] = \'0\';\n    }\n    padlen = min - iplace - max - (max > 0 ? 1 : 0) - ((signvalue) ? 1 : 0);\n    if (realstyle == E_FORMAT)\n        padlen -= 2 + eplace;\n    zpadlen = max - fplace;\n    if (zpadlen < 0)\n        zpadlen = 0;\n    if (padlen < 0)\n        padlen = 0;\n    if (flags & DP_F_MINUS)\n        padlen = -padlen;\n    if ((flags & DP_F_ZERO) && (padlen > 0)) {\n        if (signvalue) {\n            if (!doapr_outch(sbuffer, buffer, currlen, maxlen, signvalue))\n                return 0;\n            --padlen;\n            signvalue = 0;\n        }\n        while (padlen > 0) {\n            if (!doapr_outch(sbuffer, buffer, currlen, maxlen, \'0\'))\n                return 0;\n            --padlen;\n        }\n    }\n    while (padlen > 0) {\n        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, \' \'))\n            return 0;\n        --padlen;\n    }\n    if (signvalue && !doapr_outch(sbuffer, buffer, currlen, maxlen, signvalue))\n        return 0;\n    while (iplace > 0) {\n        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, iconvert[--iplace]))\n            return 0;\n    }\n    if (max > 0 || (flags & DP_F_NUM)) {\n        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, \'.\'))\n            return 0;\n        while (fplace > 0) {\n            if(!doapr_outch(sbuffer, buffer, currlen, maxlen,\n                            fconvert[--fplace]))\n                return 0;\n        }\n    }\n    while (zpadlen > 0) {\n        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, \'0\'))\n            return 0;\n        --zpadlen;\n    }\n    if (realstyle == E_FORMAT) {\n        char ech;\n        if ((flags & DP_F_UP) == 0)\n            ech = \'e\';\n        else\n            ech = \'E\';\n        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ech))\n                return 0;\n        if (exp < 0) {\n            if (!doapr_outch(sbuffer, buffer, currlen, maxlen, \'-\'))\n                    return 0;\n        } else {\n            if (!doapr_outch(sbuffer, buffer, currlen, maxlen, \'+\'))\n                    return 0;\n        }\n        while (eplace > 0) {\n            if (!doapr_outch(sbuffer, buffer, currlen, maxlen,\n                             econvert[--eplace]))\n                return 0;\n        }\n    }\n    while (padlen < 0) {\n        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, \' \'))\n            return 0;\n        ++padlen;\n    }\n    return 1;\n}', 'static LDOUBLE abs_val(LDOUBLE value)\n{\n    LDOUBLE result = value;\n    if (value < 0)\n        result = -value;\n    return result;\n}']