3 Feb
2007
3 Feb
'07
10:37 a.m.
Rich,
Look at the first paragraph of code after the declarations in this function:
The indentation clearly indicates that all this code goes with the true clause of the first if statement, but the compiler sees:
if ((sign1 = is_bn_neg(n1)) != 0) /* =, not == */ neg_a_bn(n1); samevar = (n1 == n2); if (!samevar) /* check to see if they're the same pointer */ if ((sign2 = is_bn_neg(n2)) != 0) /* =, not == */ neg_a_bn(n2);
Which is the true intention?
Comparing the code in bignumc.c to the assembly equivalent in bignuma.asm shows that the compiler is correct. We want to do the second compare only if the two numbers are not the same. Jonathan