diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2017-04-27 10:51:50 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2017-04-27 10:51:50 (GMT) |
commit | 08266ba63bcae218ba1c574d6128462468670b80 (patch) | |
tree | c79464525a30e9ec7b22e50b073abb23b716c405 /generic/tclProc.c | |
parent | 90fde58143eea5e3f626221a006cf6ac3e398ebe (diff) | |
parent | ada887f2ef7727135a81639bc1fd6513ef6c8f43 (diff) | |
download | tcl-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.c | 35 |
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 |