diff options
author | hobbs <hobbs@noemail.net> | 2000-12-10 03:26:04 (GMT) |
---|---|---|
committer | hobbs <hobbs@noemail.net> | 2000-12-10 03:26:04 (GMT) |
commit | a112fcc57f02e1a716376099ecca620bd56b87d3 (patch) | |
tree | 3f7fcdf788ef829bff73cd8e9989bae2375a12e3 /generic | |
parent | cfa2cc2dc6bf964dae0242af86a87138b8d5ff4d (diff) | |
download | tcl-a112fcc57f02e1a716376099ecca620bd56b87d3.zip tcl-a112fcc57f02e1a716376099ecca620bd56b87d3.tar.gz tcl-a112fcc57f02e1a716376099ecca620bd56b87d3.tar.bz2 |
* docs/scan.n:
* tests/scan.test:
* generic/tclScan.c (Tcl_ScanObjCmd): changed %o and %x to use
strtoul instead of strtol to correctly preserve scan<>format
conversion of large integers. [Patch #102663, Bug #124600]
FossilOrigin-Name: 4fc2144f42e5548cc563c06e00046c96df5930f7
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclExecute.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c index cdc0724..d2abb48 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -10,7 +10,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.16 2000/11/24 15:29:51 dkf Exp $ + * RCS: @(#) $Id: tclExecute.c,v 1.17 2000/12/10 03:26:04 hobbs Exp $ */ #include "tclInt.h" @@ -2505,16 +2505,18 @@ TclExecuteByteCode(interp, codePtr) case INST_LNOT: { /* - * The operand must be numeric. If the operand object is - * unshared modify it directly, otherwise create a copy to - * modify: this is "copy on write". free any old string - * representation since it is now invalid. + * The operand must be numeric or a boolean string as + * accepted by Tcl_GetBooleanFromObj(). If the operand + * object is unshared modify it directly, otherwise + * create a copy to modify: this is "copy on write". + * Free any old string representation since it is now + * invalid. */ - + double d; int boolvar; Tcl_ObjType *tPtr; - + valuePtr = POP_OBJECT(); tPtr = valuePtr->typePtr; if ((tPtr != &tclIntType) && ((tPtr != &tclDoubleType) @@ -2546,12 +2548,12 @@ TclExecuteByteCode(interp, codePtr) } tPtr = valuePtr->typePtr; } - + if (Tcl_IsShared(valuePtr)) { /* * Create a new object. */ - if (tPtr == &tclIntType) { + if ((tPtr == &tclIntType) || (tPtr == &tclBooleanType)) { i = valuePtr->internalRep.longValue; objPtr = Tcl_NewLongObj( (*pc == INST_UMINUS)? -i : !i); @@ -2575,7 +2577,7 @@ TclExecuteByteCode(interp, codePtr) /* * valuePtr is unshared. Modify it directly. */ - if (tPtr == &tclIntType) { + if ((tPtr == &tclIntType) || (tPtr == &tclBooleanType)) { i = valuePtr->internalRep.longValue; Tcl_SetLongObj(valuePtr, (*pc == INST_UMINUS)? -i : !i); |