summaryrefslogtreecommitdiffstats
path: root/generic/tclEnsemble.c
diff options
context:
space:
mode:
authorsebres <sebres@users.sourceforge.net>2024-06-19 12:31:28 (GMT)
committersebres <sebres@users.sourceforge.net>2024-06-19 12:31:28 (GMT)
commit6a936241849e1e8d7bb0a9971b412dff403f7e05 (patch)
tree46c2664ede428c7fd3ac1d481c21caa116f5b12f /generic/tclEnsemble.c
parentfa72dbaf85b8d01fdbcf5ca23b3cb8f151a885fc (diff)
parent4b36a58ba9f33dd9a752970c0c527c96fa369462 (diff)
downloadtcl-6a936241849e1e8d7bb0a9971b412dff403f7e05.zip
tcl-6a936241849e1e8d7bb0a9971b412dff403f7e05.tar.gz
tcl-6a936241849e1e8d7bb0a9971b412dff403f7e05.tar.bz2
merge 8.7
Diffstat (limited to 'generic/tclEnsemble.c')
-rw-r--r--generic/tclEnsemble.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c
index bdf486a..915a916 100644
--- a/generic/tclEnsemble.c
+++ b/generic/tclEnsemble.c
@@ -1704,6 +1704,8 @@ TclMakeEnsemble(
TCL_AUTO_LENGTH))) {
Tcl_Panic("%s", Tcl_GetStringResult(interp));
}
+ /* don't compile unsafe subcommands in safe interp */
+ cmdPtr->compileProc = NULL;
} else {
/*
* Not hidden, so just create it. Yay!
@@ -1713,8 +1715,8 @@ TclMakeEnsemble(
Tcl_NRCreateCommand(interp, TclGetString(toObj),
map[i].proc, map[i].nreProc, map[i].clientData,
NULL);
+ cmdPtr->compileProc = map[i].compileProc;
}
- cmdPtr->compileProc = map[i].compileProc;
}
}
Tcl_SetEnsembleMappingDict(interp, ensemble, mapDict);
@@ -3222,7 +3224,7 @@ TclCompileEnsemble(
Tcl_IncrRefCount(targetCmdObj);
newCmdPtr = (Command *) Tcl_GetCommandFromObj(interp, targetCmdObj);
TclDecrRefCount(targetCmdObj);
- if (newCmdPtr == NULL || Tcl_IsSafe(interp)
+ if (newCmdPtr == NULL || (Tcl_IsSafe(interp) && !cmdPtr->compileProc)
|| newCmdPtr->nsPtr->flags & NS_SUPPRESS_COMPILATION
|| newCmdPtr->flags & CMD_HAS_EXEC_TRACES
|| ((Interp *) interp)->flags & DONT_COMPILE_CMDS_INLINE) {
@@ -3230,7 +3232,6 @@ TclCompileEnsemble(
* Maps to an undefined command or a command without a compiler.
* Cannot compile.
*/
-
goto cleanup;
}
cmdPtr = newCmdPtr;