summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
diff options
context:
space:
mode:
authorrmax <rmax@noemail.net>2005-12-12 11:28:21 (GMT)
committerrmax <rmax@noemail.net>2005-12-12 11:28:21 (GMT)
commitf194fa8e5ff0780f944dcc0b2bd16e9fa55e4d44 (patch)
treedf0dd8c2d195a2222f37a8b228cc6b19f6106260 /generic/tclExecute.c
parent609712cae462ffdaaaf2ec566605e15c5f52acea (diff)
downloadtcl-f194fa8e5ff0780f944dcc0b2bd16e9fa55e4d44.zip
tcl-f194fa8e5ff0780f944dcc0b2bd16e9fa55e4d44.tar.gz
tcl-f194fa8e5ff0780f944dcc0b2bd16e9fa55e4d44.tar.bz2
* generic/tclExecute.c (ExprAbsFunc): fixed the abs(MIN_INT) case
so that it doesn't break on compilers that don't assume integers to wrap around (e.g. gcc-4.1.0). FossilOrigin-Name: fee8d56e879679b7274145d624b8b944065afdd7
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r--generic/tclExecute.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index c238a98..34e4ec1 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -11,7 +11,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.94.2.17 2005/10/28 03:26:32 mdejong Exp $
+ * RCS: @(#) $Id: tclExecute.c,v 1.94.2.18 2005/12/12 11:28:22 rmax Exp $
*/
#include "tclInt.h"
@@ -5074,8 +5074,7 @@ ExprAbsFunc(interp, eePtr, clientData)
if (valuePtr->typePtr == &tclIntType) {
i = valuePtr->internalRep.longValue;
if (i < 0) {
- iResult = -i;
- if (iResult < 0) {
+ if (i == LONG_MIN) {
#ifdef TCL_WIDE_INT_IS_LONG
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"integer value too large to represent", -1));
@@ -5094,6 +5093,7 @@ ExprAbsFunc(interp, eePtr, clientData)
#endif
}
+ iResult = -i;
} else {
iResult = i;
}