Tcl Source Code

Artifact [8cf81fef7d]
Login

Artifact 8cf81fef7dd27bc7a1816a9b8c8ca1bd3e44a3ab:

Attachment "tcl-abs.patch" to ticket [1241572fff] added by rmax 2005-12-12 18:38:41.
--- generic/tclExecute.c
+++ generic/tclExecute.c
@@ -5074,8 +5074,7 @@
     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 @@
 #endif
 
 	    }
+	    iResult = -i;
 	} else {
 	    iResult = i;
 	}