diff options
author | hobbs <hobbs> | 2001-08-31 17:53:57 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2001-08-31 17:53:57 (GMT) |
commit | 817b9b601b9d9554766f2d5993eff50a07a733d6 (patch) | |
tree | a8425b7ecd0a7b270bdb51dfc66b53d5f7cf52c1 /generic | |
parent | 9079a1dab3c2e0624379fcbac05dc8fdb9bafde5 (diff) | |
download | tcl-817b9b601b9d9554766f2d5993eff50a07a733d6.zip tcl-817b9b601b9d9554766f2d5993eff50a07a733d6.tar.gz tcl-817b9b601b9d9554766f2d5993eff50a07a733d6.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')
-rw-r--r-- | generic/tclUtil.c | 7 |
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); } |