summaryrefslogtreecommitdiffstats
path: root/generic/tclProc.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2017-04-27 10:51:50 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2017-04-27 10:51:50 (GMT)
commit08266ba63bcae218ba1c574d6128462468670b80 (patch)
treec79464525a30e9ec7b22e50b073abb23b716c405 /generic/tclProc.c
parent90fde58143eea5e3f626221a006cf6ac3e398ebe (diff)
parentada887f2ef7727135a81639bc1fd6513ef6c8f43 (diff)
downloadtcl-08266ba63bcae218ba1c574d6128462468670b80.zip
tcl-08266ba63bcae218ba1c574d6128462468670b80.tar.gz
tcl-08266ba63bcae218ba1c574d6128462468670b80.tar.bz2
[50750c735a] Fix broken test and stop reading uninit-but-allocated memory in zlib channel transform.
Diffstat (limited to 'generic/tclProc.c')
-rw-r--r--generic/tclProc.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/generic/tclProc.c b/generic/tclProc.c
index 373192c..96bdcf3 100644
--- a/generic/tclProc.c
+++ b/generic/tclProc.c
@@ -2750,6 +2750,41 @@ MakeLambdaError(
}
/*
+ *----------------------------------------------------------------------
+ *
+ * TclGetCmdFrameForProcedure --
+ *
+ * How to get the CmdFrame information for a procedure.
+ *
+ * Results:
+ * A pointer to the CmdFrame (only guaranteed to be valid until the next
+ * Tcl command is processed or the interpreter's state is otherwise
+ * modified) or a NULL if the information is not available.
+ *
+ * Side effects:
+ * none.
+ *
+ *----------------------------------------------------------------------
+ */
+
+CmdFrame *
+TclGetCmdFrameForProcedure(
+ Proc *procPtr) /* The procedure whose cmd-frame is to be
+ * looked up. */
+{
+ Tcl_HashEntry *hePtr;
+
+ if (procPtr == NULL || procPtr->iPtr == NULL) {
+ return NULL;
+ }
+ hePtr = Tcl_FindHashEntry(procPtr->iPtr->linePBodyPtr, procPtr);
+ if (hePtr == NULL) {
+ return NULL;
+ }
+ return (CmdFrame *) Tcl_GetHashValue(hePtr);
+}
+
+/*
* Local Variables:
* mode: c
* c-basic-offset: 4