crypto/bn/bntest.c:1842: error: INTEGER_OVERFLOW_L2
  ([0, +oo] - 1):unsigned64 by call to `BN_lshift`.
Showing all 5 steps of the trace


crypto/bn/bntest.c:1822:1: Parameter `a_->top`
1820.   	}
1821.   
1822. > int test_lshift(BIO *bp,BN_CTX *ctx,BIGNUM *a_)
1823.   	{
1824.   	BIGNUM *a,*b,*c,*d;

crypto/bn/bntest.c:1842:3: Call
1840.   	for (i=0; i<num0; i++)
1841.   		{
1842.   		BN_lshift(b,a,i+1);
          ^
1843.   		BN_add(c,c,c);
1844.   		if (bp != NULL)

crypto/bn/bn_shift.c:132:1: <LHS trace>
130.   	}
131.   
132. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
133.   	{
134.   	int i,nw,lb,rb;

crypto/bn/bn_shift.c:132:1: Parameter `a->top`
  130.   	}
  131.   
  132. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
  133.   	{
  134.   	int i,nw,lb,rb;

crypto/bn/bn_shift.c:150:8: Binary operation: ([0, +oo] - 1):unsigned64 by call to `BN_lshift` 
  148.   	t[a->top+nw]=0;
  149.   	if (lb == 0)
  150.   		for (i=a->top-1; i>=0; i--)
                ^
  151.   			t[nw+i]=f[i];
  152.   	else

int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
	{
	int i,nw,lb,rb;
	BN_ULONG *t,*f;
	BN_ULONG l;
	bn_check_top(r);
	bn_check_top(a);
	r->neg=a->neg;
	nw=n/BN_BITS2;
	if (bn_wexpand(r,a->top+nw+1) == NULL) return(0);
	lb=n%BN_BITS2;
	rb=BN_BITS2-lb;
	f=a->d;
	t=r->d;
	t[a->top+nw]=0;
	if (lb == 0)
		for (i=a->top-1; i>=0; i--)
			t[nw+i]=f[i];
	else
		for (i=a->top-1; i>=0; i--)
			{
			l=f[i];
			t[nw+i+1]|=(l>>rb)&BN_MASK2;
			t[nw+i]=(l<<lb)&BN_MASK2;
			}
	memset(t,0,nw*sizeof(t[0]));
	r->top=a->top+nw+1;
	bn_correct_top(r);
	bn_check_top(r);
	return(1);
	}
['int test_lshift(BIO *bp,BN_CTX *ctx,BIGNUM *a_)\n\t{\n\tBIGNUM *a,*b,*c,*d;\n\tint i;\n\tb=BN_new();\n\tc=BN_new();\n\td=BN_new();\n\tBN_one(c);\n\tif(a_)\n\t    a=a_;\n\telse\n\t    {\n\t    a=BN_new();\n\t    BN_bntest_rand(a,200,0,0);\n\t    a->neg=rand_neg();\n\t    }\n\tfor (i=0; i<num0; i++)\n\t\t{\n\t\tBN_lshift(b,a,i+1);\n\t\tBN_add(c,c,c);\n\t\tif (bp != NULL)\n\t\t\t{\n\t\t\tif (!results)\n\t\t\t\t{\n\t\t\t\tBN_print(bp,a);\n\t\t\t\tBIO_puts(bp," * ");\n\t\t\t\tBN_print(bp,c);\n\t\t\t\tBIO_puts(bp," - ");\n\t\t\t\t}\n\t\t\tBN_print(bp,b);\n\t\t\tBIO_puts(bp,"\\n");\n\t\t\t}\n\t\tBN_mul(d,a,c,ctx);\n\t\tBN_sub(d,d,b);\n\t\tif(!BN_is_zero(d))\n\t\t    {\n\t\t    fprintf(stderr,"Left shift test failed!\\n");\n\t\t    fprintf(stderr,"a=");\n\t\t    BN_print_fp(stderr,a);\n\t\t    fprintf(stderr,"\\nb=");\n\t\t    BN_print_fp(stderr,b);\n\t\t    fprintf(stderr,"\\nc=");\n\t\t    BN_print_fp(stderr,c);\n\t\t    fprintf(stderr,"\\nd=");\n\t\t    BN_print_fp(stderr,d);\n\t\t    fprintf(stderr,"\\n");\n\t\t    return 0;\n\t\t    }\n\t\t}\n\tBN_free(a);\n\tBN_free(b);\n\tBN_free(c);\n\tBN_free(d);\n\treturn(1);\n\t}', 'int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)\n\t{\n\tint i,nw,lb,rb;\n\tBN_ULONG *t,*f;\n\tBN_ULONG l;\n\tbn_check_top(r);\n\tbn_check_top(a);\n\tr->neg=a->neg;\n\tnw=n/BN_BITS2;\n\tif (bn_wexpand(r,a->top+nw+1) == NULL) return(0);\n\tlb=n%BN_BITS2;\n\trb=BN_BITS2-lb;\n\tf=a->d;\n\tt=r->d;\n\tt[a->top+nw]=0;\n\tif (lb == 0)\n\t\tfor (i=a->top-1; i>=0; i--)\n\t\t\tt[nw+i]=f[i];\n\telse\n\t\tfor (i=a->top-1; i>=0; i--)\n\t\t\t{\n\t\t\tl=f[i];\n\t\t\tt[nw+i+1]|=(l>>rb)&BN_MASK2;\n\t\t\tt[nw+i]=(l<<lb)&BN_MASK2;\n\t\t\t}\n\tmemset(t,0,nw*sizeof(t[0]));\n\tr->top=a->top+nw+1;\n\tbn_correct_top(r);\n\tbn_check_top(r);\n\treturn(1);\n\t}']