diff --git a/CHANGES b/CHANGES index 3d5d802..d311d63 100644 --- a/CHANGES +++ b/CHANGES @@ -19,6 +19,13 @@ The following are the changes from calc version 2.11.0t10 to date: The 'unused value ignored' messages now start with Line 999: instead of just 999:. + Fixed some typos in the help files as reported by Klaus Alexander + Seistrup . + + Fixed the long standing issue first reported by Saber-C in the + domul() function in zmil.c thanks to a patch by Ernest Bowen + . + The following are the changes from calc version 2.11.0t8.9.1 to 2.11.0t9.4.5: diff --git a/version.c b/version.c index d0ae284..e52869b 100644 --- a/version.c +++ b/version.c @@ -18,7 +18,7 @@ static char *program; #define MAJOR_VER 2 /* major version */ #define MINOR_VER 11 /* minor version */ #define MAJOR_PATCH 0 /* patch level or 0 if no patch */ -#define MINOR_PATCH "10.1.4" /* test number or empty string if no patch */ +#define MINOR_PATCH "10.2" /* test number or empty string if no patch */ /* * calc version constants diff --git a/zmul.c b/zmul.c index aa7c7a2..b346980 100644 --- a/zmul.c +++ b/zmul.c @@ -279,106 +279,7 @@ domul(HALF *v1, LEN size1, HALF *v2, LEN size2, HALF *ans) */ baseA = v1 + shift; baseB = v1; - /* - * XXX - is this still an issue? - * - * Saber-C Version 3.1 says: - * - * W#26, Storing a bad pointer into auto variable dmul`baseC. - * - * This warning is issued during the regression test #026 - * (read cryrand). - * - * Saver-C claims that v2+shift is past the end of allocated - * memory for v2. - * - * This warning may be triggered by executing the following code: - * - * a = 0xffff0000ffffffff00000000ffff0000000000000000ffff; - * config("mul2", 2); - * pmod(3,a-1,a); - * - * [[ NOTE: The above code no longer invokes this code. ]] - * - * When this code is executed, shift == 6 and v2 is 3 shorts - * long (size2 == 2). This baseC points 3 shorts beyond the - * allocated end of v2. - * - * The stack was as follows: [[NOTE: line numbers may have changed]] - * - * domul(v1=0x2d93d8, size1=12, - * v2=0x2ded30, size2=2, ans=0x2ee8a8) at "zmul.c":313 - * zmul(z1=0x2ee928, z2=0x2ee92c, res=0x16d8c0) at "zmul.c":73 - * zpowermod(z1=0x2ee828, z2=0x2ee82c, - * z3=0x2ee830, res=0x57bfe4) at "zmod.c":666 - * qpowermod(q1=0x57bf90, q2=0x57bfc8, q3=0x57bf3c) at "qfunc.c":78 - * builtinfunc(...) at "func.c":400 - * o_call(...) at "opcodes.c":2094 - * calculate(...) at "opcodes.c":288 - * evaluate(...) at "codegen.c":170 - * getcommands(...) at "codegen.c":109 - * main(...) at "calc.c":167 - * - * The final domul() call point is the next executable line below. - * - **** - * - * The insure tool also reports a problem at this position: - * - * [zmul.c:319] **COPY_BAD_RANGE** - * >> baseC = v2 + shift; - * - * Copying pointer which is out-of-range: v2 + shift - * - * [[NOTE: line numbers may have changed]] - * - * Pointer : 0x1400919cc - * Actual block : 0x140090c80 thru 0x140090def (368 bytes,92 elements) - * hp, allocated at: - * malloc() - * alloc() zmath.c, 221 - * zmul() zmul.c, 73 - * ztenpow() zfunc.c, 441 - * str2q() qio.c, 537 - * addnumber() const.c, 52 - * eatnumber() token.c, 594 - * gettoken() token.c, 319 - * getcallargs() codegen.c, 2358 - * - * Stack trace where the error occurred: - * domul() zmul.c, 319 - * zmul() zmul.c, 74 - * ztenpow() zfunc.c, 441 - * str2q() qio.c, 537 - * addnumber() const.c, 52 - * eatnumber() token.c, 594 - * gettoken() token.c, 319 - * getcallargs() codegen.c, 2358 - * getidexpr() codegen.c, 1998 - * getterm() codegen.c, 1936 - * getincdecexpr() codegen.c, 1820 - * getreference() codegen.c, 1804 - * getshiftexpr() codegen.c, 1758 - * getandexpr() codegen.c, 1704 - * getorexpr() codegen.c, 1682 - * getproduct() codegen.c, 1654 - * getsum() codegen.c, 1626 - * getrelation() codegen.c, 1585 - * getandcond() codegen.c, 1556 - * getorcond() codegen.c, 1532 - * getaltcond() codegen.c, 1499 - * getassignment() codegen.c, 1442 - * getopassignment() codegen.c, 1352 - * getexprlist() codegen.c, 1318 - * getstatement() codegen.c, 921 - * evaluate() codegen.c, 219 - * getcommands() codegen.c, 165 - * main() calc.c, 321 - * - * The final domul() call point is the next executable line below. - */ - /* ok to ignore on name domul`baseC */ - baseC = v2 + shift; + baseC = v2 + ((shift <= size2) ? shift : size2); baseD = v2; baseAB = ans; baseDC = ans + shift;