diff options
author | Miguel Sofer <miguel.sofer@gmail.com> | 2008-10-12 19:53:32 (GMT) |
---|---|---|
committer | Miguel Sofer <miguel.sofer@gmail.com> | 2008-10-12 19:53:32 (GMT) |
commit | 73e618c2bec30116d7b413e8776a74a8fbf4427d (patch) | |
tree | b62984cea2140c3e91a68a973ef9f2bf1a49b090 | |
parent | 5c0c022b7d9b60ca496702f7cb865df85456c948 (diff) | |
download | tcl-73e618c2bec30116d7b413e8776a74a8fbf4427d.zip tcl-73e618c2bec30116d7b413e8776a74a8fbf4427d.tar.gz tcl-73e618c2bec30116d7b413e8776a74a8fbf4427d.tar.bz2 |
* generic/tclCompile.c: fix bug in srcDelta encoding within
ByteCodes. The bug can only be triggered under conditions that
cannot happen in Tcl, but were met during development of L. Thanks
go to Robert Netzer for diagnose and fix.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | generic/tclCompile.c | 6 |
2 files changed, 10 insertions, 3 deletions
@@ -1,3 +1,10 @@ +2008-10-12 Miguel Sofer <msofer@users.sf.net> + + * generic/tclCompile.c: fix bug in srcDelta encoding within + ByteCodes. The bug can only be triggered under conditions that + cannot happen in Tcl, but were met during development of L. Thanks + go to Robert Netzer for diagnose and fix. + 2008-10-10 Don Porter <dgp@users.sourceforge.net> *** 8.6a3 TAGGED FOR RELEASE *** diff --git a/generic/tclCompile.c b/generic/tclCompile.c index c55258f..b347018 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.157 2008/10/05 20:47:52 nijtmans Exp $ + * RCS: @(#) $Id: tclCompile.c,v 1.158 2008/10/12 19:53:32 msofer Exp $ */ #include "tclInt.h" @@ -3177,7 +3177,7 @@ GetCmdLocEncodingSize( } srcDelta = (mapPtr[i].srcOffset - prevSrcOffset); - if ((-127 <= srcDelta) && (srcDelta <= 127)) { + if ((-127 <= srcDelta) && (srcDelta <= 127) && (srcDelta != -1)) { srcDeltaNext++; } else { srcDeltaNext += 5; /* 1 byte for 0xFF, 4 for delta */ @@ -3285,7 +3285,7 @@ EncodeCmdLocMap( prevOffset = 0; for (i = 0; i < numCmds; i++) { srcDelta = (mapPtr[i].srcOffset - prevOffset); - if ((-127 <= srcDelta) && (srcDelta <= 127)) { + if ((-127 <= srcDelta) && (srcDelta <= 127) && (srcDelta != -1)) { TclStoreInt1AtPtr(srcDelta, p); p++; } else { |