summaryrefslogtreecommitdiffstats
path: root/generic/tclUtil.c
diff options
context:
space:
mode:
authorhobbs <hobbs>2001-08-31 17:53:57 (GMT)
committerhobbs <hobbs>2001-08-31 17:53:57 (GMT)
commit38c26e6e74a4f25c583963e2d91fe06926d0ef8b (patch)
treea8425b7ecd0a7b270bdb51dfc66b53d5f7cf52c1 /generic/tclUtil.c
parentf7ce0725b01ae37d89eef3d42bcd0682b8443771 (diff)
downloadtcl-38c26e6e74a4f25c583963e2d91fe06926d0ef8b.zip
tcl-38c26e6e74a4f25c583963e2d91fe06926d0ef8b.tar.gz
tcl-38c26e6e74a4f25c583963e2d91fe06926d0ef8b.tar.bz2
* tests/compile.test: added compile-11.* interp result checks
* generic/tclUtil.c (TclGetIntForIndex): added Tcl_ResetResult before Tcl_AppendStringsToObj to prevent shared object crash when called from bcc instruction. The Tcl_Append* calls that append to the result object that are invoked by bcc insts must remember to call Tcl_ResetResult because the bcc doesn't do this for us. [Bug #456892]
Diffstat (limited to 'generic/tclUtil.c')
-rw-r--r--generic/tclUtil.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index daab08c..96deda9 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.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: tclUtil.c,v 1.21 2001/07/31 19:12:07 vincentdarley Exp $
+ * RCS: @(#) $Id: tclUtil.c,v 1.22 2001/08/31 17:53:57 hobbs Exp $
*/
#include "tclInt.h"
@@ -2182,6 +2182,7 @@ TclGetIntForIndex(interp, objPtr, endValue, indexPtr)
} else {
intforindex_error:
if ((Interp *)interp != NULL) {
+ Tcl_ResetResult(interp);
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
"bad index \"", bytes,
"\": must be integer or end?-integer?", (char *) NULL);
@@ -2239,6 +2240,10 @@ TclCheckBadOctal(interp, value)
if (*p == '\0') {
/* Reached end of string */
if (interp != NULL) {
+ /*
+ * Don't reset the result here because we want this result
+ * to be added to an existing error message as extra info.
+ */
Tcl_AppendResult(interp, " (looks like invalid octal number)",
(char *) NULL);
}