summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
Diffstat (limited to 'generic')
-rw-r--r--generic/tclBasic.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index 5c36bbc..4414c52 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclBasic.c,v 1.164 2005/07/26 17:06:12 dgp Exp $
+ * RCS: @(#) $Id: tclBasic.c,v 1.165 2005/08/05 18:50:27 kennykb Exp $
*/
#include "tclInt.h"
@@ -5091,12 +5091,20 @@ ExprAbsFunc(clientData, interp, objc, objv)
if (i < 0) {
iResult = -i;
if (iResult < 0) {
- /* FIXME: This should promote to wide! */
+#ifdef TCL_WIDE_INT_IS_LONG
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"integer value too large to represent", -1));
Tcl_SetErrorCode(interp, "ARITH", "IOVERFLOW",
"integer value too large to represent", (char *) NULL);
return TCL_ERROR;
+#else
+ /*
+ * Special case: abs(MIN_INT) must promote to wide.
+ */
+ TclNewWideIntObj(oResult, -(Tcl_WideInt) i);
+ Tcl_SetObjResult(interp, oResult);
+ return TCL_OK;
+#endif
}
} else {
iResult = i;