diff options
| author | ferrieux@users.sourceforge.net <ferrieux> | 2011-08-09 17:01:16 (GMT) |
|---|---|---|
| committer | ferrieux@users.sourceforge.net <ferrieux> | 2011-08-09 17:01:16 (GMT) |
| commit | 623d17cd799d504dde63708c622e4f31b87d6708 (patch) | |
| tree | 07db51e401be8d97cacd6e665d64e168ebc4802a /generic/tclResult.c | |
| parent | e28099940b45e61945dba656309e26ea5370a170 (diff) | |
| download | tcl-623d17cd799d504dde63708c622e4f31b87d6708.zip tcl-623d17cd799d504dde63708c622e4f31b87d6708.tar.gz tcl-623d17cd799d504dde63708c622e4f31b87d6708.tar.bz2 | |
[Bug 3386417] avoid a reference loop between the bytecode and its companion errostack when compiling a syntax error.
Diffstat (limited to 'generic/tclResult.c')
| -rw-r--r-- | generic/tclResult.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/generic/tclResult.c b/generic/tclResult.c index 60bae73..4443cc1 100644 --- a/generic/tclResult.c +++ b/generic/tclResult.c @@ -1599,6 +1599,29 @@ Tcl_GetReturnOptions( /* *------------------------------------------------------------------------- * + * TclNoErrorStack -- + * + * Removes the -errorstack entry from an options dict to avoid reference cycles + * + * Results: + * The (unshared) argument options dict, modified in -place. + * + *------------------------------------------------------------------------- + */ + +Tcl_Obj * +TclNoErrorStack(Tcl_Interp *interp, Tcl_Obj *options) +{ + Tcl_Obj **keys = GetKeys(); + + Tcl_DictObjRemove(interp, options, keys[KEY_ERRORSTACK]); + + return options; +} + +/* + *------------------------------------------------------------------------- + * * Tcl_SetReturnOptions -- * * Accepts an interp and a dictionary of return options, and sets the |
