summaryrefslogtreecommitdiffstats
path: root/generic/tclEnsemble.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2013-01-04 14:38:37 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2013-01-04 14:38:37 (GMT)
commit18d9d66f4d3a6a8b468474e25d5bacee500bda85 (patch)
tree709b0fa2e8d57aef2948a721b619752b157d6a4b /generic/tclEnsemble.c
parent09d1473b3be04898d6ec67abcad0b980fdd88df6 (diff)
downloadtcl-18d9d66f4d3a6a8b468474e25d5bacee500bda85.zip
tcl-18d9d66f4d3a6a8b468474e25d5bacee500bda85.tar.gz
tcl-18d9d66f4d3a6a8b468474e25d5bacee500bda85.tar.bz2
Fix bad memory access problems found by Miguel Sofer when valgrinding.
Diffstat (limited to 'generic/tclEnsemble.c')
-rw-r--r--generic/tclEnsemble.c13
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;