From 83badefdb71b863f0580d1ee3d6270c5102ba3d9 Mon Sep 17 00:00:00 2001 From: dkf Date: Thu, 15 Jul 2010 21:00:25 +0000 Subject: * generic/tclExecute.c (TclExecuteByteCode): Ensure that [dict get] * generic/tclDictObj.c (DictGetCmd): always generates an errorCode on a failure to look up an entry. --- ChangeLog | 44 +++++++++++++++++++++++++------------------- generic/tclDictObj.c | 6 ++++-- generic/tclExecute.c | 4 +++- 3 files changed, 32 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index acac42a..5b14697 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,24 +1,30 @@ +2010-07-15 Donal K. Fellows + + * generic/tclExecute.c (TclExecuteByteCode): Ensure that [dict get] + * generic/tclDictObj.c (DictGetCmd): always generates an errorCode on + a failure to look up an entry. + 2010-07-11 Pat Thoyts * unix/configure: (regenerated) * unix/configure.in: For the NATIVE_TCLSH variable use the autoconf - * unix/Makefile.in: SC_PROG_TCLSH to try and find a locally - installed native binary. This avoids manually fixing up when cross - compiling. If there is not one, revert to using the build product. + * unix/Makefile.in: SC_PROG_TCLSH to try and find a locally installed + native binary. This avoids manually fixing up when cross compiling. If + there is not one, revert to using the build product. 2010-07-02 Don Porter - * generic/tclInt.decs: Reverted to the original TIP 337 implementation - on what to do with the obsolete internal stub for + * generic/tclInt.decs: Reverted to the original TIP 337 + implementation on what to do with the obsolete internal stub for TclBackgroundException() (eliminate it!) * generic/tclIntDecls.h: make genstubs * generic/tclStubInit.c: 2010-07-02 Jan Nijtmans - * generic/tclInt.decls [Bug #803489] Tcl_FindNamespace problem in the - * generic/tclIntDecls.h Stubs table - * generic/tclStubInit.c + * generic/tclInt.decls: [Bug 803489]: Tcl_FindNamespace problem in the + * generic/tclIntDecls.h: Stubs table + * generic/tclStubInit.c: 2010-07-02 Donal K. Fellows @@ -29,17 +35,17 @@ 2010-07-01 Jan Nijtmans - * win/rules.vc [Bug #3020677] wish can't link reg1.2 - * tools/checkLibraryDoc.tcl formatting, spacing, cleanup unused variables - * tools/eolFix.tcl no change in generated output - * tools/fix_tommath_h.tcl - * tools/genStubs.tcl - * tools/index.tcl - * tools/man2help2.tcl - * tools/regexpTestLib.tcl - * tools/tsdPerf.tcl - * tools/uniClass.tcl - * tools/uniParse.tcl + * win/rules.vc: [Bug 3020677]: wish can't link reg1.2 + * tools/checkLibraryDoc.tcl: formatting, spacing, cleanup unused + * tools/eolFix.tcl: variables; no change in generated output + * tools/fix_tommath_h.tcl: + * tools/genStubs.tcl: + * tools/index.tcl: + * tools/man2help2.tcl: + * tools/regexpTestLib.tcl: + * tools/tsdPerf.tcl: + * tools/uniClass.tcl: + * tools/uniParse.tcl: 2010-07-01 Donal K. Fellows diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c index e0aea5b..a2a8dd0 100644 --- a/generic/tclDictObj.c +++ b/generic/tclDictObj.c @@ -4,12 +4,12 @@ * This file contains functions that implement the Tcl dict object type * and its accessor command. * - * Copyright (c) 2002 by Donal K. Fellows. + * Copyright (c) 2002-2010 by Donal K. Fellows. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclDictObj.c,v 1.82 2010/03/05 14:34:04 dkf Exp $ + * RCS: @(#) $Id: tclDictObj.c,v 1.83 2010/07/15 21:00:26 dkf Exp $ */ #include "tclInt.h" @@ -1621,6 +1621,8 @@ DictGetCmd( Tcl_ResetResult(interp); Tcl_AppendResult(interp, "key \"", TclGetString(objv[objc-1]), "\" not known in dictionary", NULL); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "DICT", + TclGetString(objv[objc-1]), NULL); return TCL_ERROR; } Tcl_SetObjResult(interp, valuePtr); diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 95e036b..73185b8 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -14,7 +14,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.487 2010/07/02 20:37:10 dkf Exp $ + * RCS: @(#) $Id: tclExecute.c,v 1.488 2010/07/15 21:00:26 dkf Exp $ */ #include "tclInt.h" @@ -5818,6 +5818,8 @@ TclExecuteByteCode( Tcl_ResetResult(interp); Tcl_AppendResult(interp, "key \"", TclGetString(OBJ_AT_TOS), "\" not known in dictionary", NULL); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "DICT", + TclGetString(OBJ_AT_TOS), NULL); TRACE_WITH_OBJ(("%u => ERROR ", opnd), Tcl_GetObjResult(interp)); } else { TRACE_WITH_OBJ(( -- cgit v0.12