summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2004-03-29 02:17:58 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2004-03-29 02:17:58 (GMT)
commit8f0d403b02d42ece1a2f24a9bf1327837480fd4e (patch)
treef29ffea15b5c1068e38c10ed20ab408d2a916114
parenta2a94771f68b17613c897f5b4ab91dfb979c85d3 (diff)
downloadtcl-8f0d403b02d42ece1a2f24a9bf1327837480fd4e.zip
tcl-8f0d403b02d42ece1a2f24a9bf1327837480fd4e.tar.gz
tcl-8f0d403b02d42ece1a2f24a9bf1327837480fd4e.tar.bz2
* generic/tclCompile.c (TclCompileScript): corrected possible
segfault when a compilation returns TCL_OUTLINE_COMPILE after having grown the compile environment [Bug 925121].
-rw-r--r--ChangeLog6
-rw-r--r--generic/tclCompile.c7
2 files changed, 10 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 72c08d4..1661a03 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-03-28 Miguel Sofer <msofer@users.sf.net>
+
+ * generic/tclCompile.c (TclCompileScript): corrected possible
+ segfault when a compilation returns TCL_OUTLINE_COMPILE after
+ having grown the compile environment [Bug 925121].
+
2004-03-21 Jeff Hobbs <jeffh@ActiveState.com>
* win/tclWinInt.h: define VER_PLATFORM_WIN32_CE if not already set.
diff --git a/generic/tclCompile.c b/generic/tclCompile.c
index a244be9..b1bd38e 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.43.2.4 2004/03/15 20:34:13 msofer Exp $
+ * RCS: @(#) $Id: tclCompile.c,v 1.43.2.5 2004/03/29 02:17:59 msofer Exp $
*/
#include "tclInt.h"
@@ -990,7 +990,8 @@ TclCompileScript(interp, script, numBytes, nested, 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);
@@ -1003,7 +1004,7 @@ TclCompileScript(interp, script, numBytes, nested, 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