diff options
| author | Miguel Sofer <miguel.sofer@gmail.com> | 2004-03-29 02:09:31 (GMT) |
|---|---|---|
| committer | Miguel Sofer <miguel.sofer@gmail.com> | 2004-03-29 02:09:31 (GMT) |
| commit | 1e9a67e3a64c25ac516395205190d6fd8d1ea00a (patch) | |
| tree | 44b037ccb7001843b128192a9490341720c871ec /generic/tclCompile.c | |
| parent | 720b72f14caabd5770e6dd526eb2ff43b0edcffc (diff) | |
| download | tcl-1e9a67e3a64c25ac516395205190d6fd8d1ea00a.zip tcl-1e9a67e3a64c25ac516395205190d6fd8d1ea00a.tar.gz tcl-1e9a67e3a64c25ac516395205190d6fd8d1ea00a.tar.bz2 | |
* generic/tclCompile.c (TclCompileScript): corrected possible
segfault when a compilation returns TCL_OUTLINE_COMPILE after
having grown the compile environment.
Diffstat (limited to 'generic/tclCompile.c')
| -rw-r--r-- | generic/tclCompile.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/generic/tclCompile.c b/generic/tclCompile.c index c8336d2..6230e06 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCompile.c,v 1.58 2004/01/20 15:39:56 dkf Exp $ + * RCS: @(#) $Id: tclCompile.c,v 1.59 2004/03/29 02:09:46 msofer Exp $ */ #include "tclInt.h" @@ -1053,7 +1053,8 @@ TclCompileScript(interp, script, numBytes, envPtr) && !(cmdPtr->flags & CMD_HAS_EXEC_TRACES) && !(iPtr->flags & DONT_COMPILE_CMDS_INLINE)) { int savedNumCmds = envPtr->numCommands; - unsigned char *savedCodeNext = envPtr->codeNext; + unsigned int savedCodeNext = + envPtr->codeNext - envPtr->codeStart; code = (*(cmdPtr->compileProc))(interp, &parse, envPtr); @@ -1066,7 +1067,7 @@ TclCompileScript(interp, script, numBytes, envPtr) * TCL_OUT_LINE_COMPILE [Bugs 705406 and 735055] */ envPtr->numCommands = savedNumCmds; - envPtr->codeNext = savedCodeNext; + envPtr->codeNext = envPtr->codeStart + savedCodeNext; } else { /* an error */ /* * There was a compilation error, the last |
