diff options
| author | donal.k.fellows@manchester.ac.uk <dkf> | 2011-08-30 00:05:19 (GMT) |
|---|---|---|
| committer | donal.k.fellows@manchester.ac.uk <dkf> | 2011-08-30 00:05:19 (GMT) |
| commit | 827eea2d7594cfaffb46a99b45ee09be4dd1bd3d (patch) | |
| tree | b5c0fc271ea0fd6dbddade04e906a194ddd9294e /generic | |
| parent | 275393e4f4c4986560b9e5e91e9500ad821bdc2e (diff) | |
| download | tcl-827eea2d7594cfaffb46a99b45ee09be4dd1bd3d.zip tcl-827eea2d7594cfaffb46a99b45ee09be4dd1bd3d.tar.gz tcl-827eea2d7594cfaffb46a99b45ee09be4dd1bd3d.tar.bz2 | |
[Bug 3398794]: Use Tcl errors in scripts, not panics.
Diffstat (limited to 'generic')
| -rw-r--r-- | generic/tclInterp.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/generic/tclInterp.c b/generic/tclInterp.c index 0b05913..058714f 100644 --- a/generic/tclInterp.c +++ b/generic/tclInterp.c @@ -4133,6 +4133,19 @@ SlaveCommandLimitCmd( ScriptLimitCallback *limitCBPtr; Tcl_HashEntry *hPtr; + /* + * First, ensure that we are not reading or writing the calling + * interpreter's limits; it may only manipulate its children. Note that + * the low level API enforces this with Tcl_Panic, which we want to + * avoid. [Bug 3398794] + */ + + if (interp == slaveInterp) { + Tcl_AppendResult(interp, + "limits on current interpreter inaccessible", NULL); + return TCL_ERROR; + } + if (objc == consumedObjc) { Tcl_Obj *dictPtr; @@ -4304,6 +4317,19 @@ SlaveTimeLimitCmd( ScriptLimitCallback *limitCBPtr; Tcl_HashEntry *hPtr; + /* + * First, ensure that we are not reading or writing the calling + * interpreter's limits; it may only manipulate its children. Note that + * the low level API enforces this with Tcl_Panic, which we want to + * avoid. [Bug 3398794] + */ + + if (interp == slaveInterp) { + Tcl_AppendResult(interp, + "limits on current interpreter inaccessible", NULL); + return TCL_ERROR; + } + if (objc == consumedObjc) { Tcl_Obj *dictPtr; |
