diff options
author | dgp <dgp@users.sourceforge.net> | 2007-08-08 20:25:03 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2007-08-08 20:25:03 (GMT) |
commit | bc492ff043ece437a95b266d390d5be0a0247380 (patch) | |
tree | ea5416fbb503bc129113c2ce7e60f3087ecbd114 /generic/tclExecute.c | |
parent | 37346f4ab8d60c9dcc09d42ea9751599215eaca7 (diff) | |
download | tcl-bc492ff043ece437a95b266d390d5be0a0247380.zip tcl-bc492ff043ece437a95b266d390d5be0a0247380.tar.gz tcl-bc492ff043ece437a95b266d390d5be0a0247380.tar.bz2 |
* generic/tclExecute.c: Corrected improper use of bignum arguments
* tests/expr.test: to *SHIFT operations. [Bug 1770224].
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r-- | generic/tclExecute.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 38480a2..b710e17 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclExecute.c,v 1.309 2007/08/05 02:46:09 das Exp $ + * RCS: @(#) $Id: tclExecute.c,v 1.310 2007/08/08 20:25:04 dgp Exp $ */ #include "tclInt.h" @@ -4506,10 +4506,14 @@ TclExecuteByteCode( invalid = (*((const Tcl_WideInt *)ptr2) < (Tcl_WideInt)0); break; #endif - case TCL_NUMBER_BIG: - /* TODO: const correctness? */ - invalid = (mp_cmp_d((mp_int *)ptr2, 0) == MP_LT); + case TCL_NUMBER_BIG: { + mp_int big2; + + Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2); + invalid = (mp_cmp_d(&big2, 0) == MP_LT); + mp_clear(&big2); break; + } default: /* Unused, here to silence compiler warning */ invalid = 0; @@ -4617,10 +4621,13 @@ TclExecuteByteCode( zero = (*(const Tcl_WideInt *)ptr1 > (Tcl_WideInt)0); break; #endif - case TCL_NUMBER_BIG: - /* TODO: const correctness ? */ - zero = (mp_cmp_d((mp_int *)ptr1, 0) == MP_GT); + case TCL_NUMBER_BIG: { + mp_int big1; + Tcl_TakeBignumFromObj(NULL, valuePtr, &big1); + zero = (mp_cmp_d(&big1, 0) == MP_GT); + mp_clear(&big1); break; + } default: /* Unused, here to silence compiler warning. */ zero = 0; |