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 | 04086099d0c1d95a1f63b2ff8b8db40b66fd5bd5 (patch) | |
tree | c79464525a30e9ec7b22e50b073abb23b716c405 /generic/tclProc.c | |
parent | 2f99ece694f932e693cee1af4efff43b6d94beeb (diff) | |
parent | 757450b24fcc9ce97b532341cf456d2dfb5fdba3 (diff) | |
download | tcl-04086099d0c1d95a1f63b2ff8b8db40b66fd5bd5.zip tcl-04086099d0c1d95a1f63b2ff8b8db40b66fd5bd5.tar.gz tcl-04086099d0c1d95a1f63b2ff8b8db40b66fd5bd5.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 |