diff options
author | dkf <dkf@noemail.net> | 2013-01-04 14:38:37 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2013-01-04 14:38:37 (GMT) |
commit | 2ccdc51b0c180159805de36188ef8f1398183c42 (patch) | |
tree | 709b0fa2e8d57aef2948a721b619752b157d6a4b /generic/tclEnsemble.c | |
parent | f41e3d927a9f276518c00612a429529f3347e537 (diff) | |
download | tcl-2ccdc51b0c180159805de36188ef8f1398183c42.zip tcl-2ccdc51b0c180159805de36188ef8f1398183c42.tar.gz tcl-2ccdc51b0c180159805de36188ef8f1398183c42.tar.bz2 |
Fix bad memory access problems found by Miguel Sofer when valgrinding.
FossilOrigin-Name: 963a7f31e2e359e6403a6d5e3b9e1d65484856da
Diffstat (limited to 'generic/tclEnsemble.c')
-rw-r--r-- | generic/tclEnsemble.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index 4e2a5cd..9a2d598 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -2956,9 +2956,14 @@ TclCompileEnsemble( Tcl_ListObjAppendElement(NULL, replaced, replacement); if (Tcl_ListObjGetElements(NULL, targetCmdObj, &len, &elems) != TCL_OK) { goto failed; - } - if (len != 1) { - goto failed; + } else if (len != 1) { + /* + * Note that at this point we know we can't issue any special + * instruction sequence as the mapping isn't one that we support at + * the compiled level. + */ + + goto cleanup; } targetCmdObj = elems[0]; @@ -3011,7 +3016,7 @@ TclCompileEnsemble( */ failed: - if (len == 1 && depth < 250) { + if (depth < 250) { if (depth > 1) { if (!invokeAnyway) { cmdPtr = oldCmdPtr; |