diff options
author | Miguel Sofer <miguel.sofer@gmail.com> | 2007-08-24 11:22:50 (GMT) |
---|---|---|
committer | Miguel Sofer <miguel.sofer@gmail.com> | 2007-08-24 11:22:50 (GMT) |
commit | b6a2ba77d8842784d7c08493108d009ae42cae1b (patch) | |
tree | 7cc29369ac67ab0b43060c14de5118c592e099a2 | |
parent | 46b11973d112f4cdf80dce0c5cbaac1e9ce0b780 (diff) | |
download | tcl-b6a2ba77d8842784d7c08493108d009ae42cae1b.zip tcl-b6a2ba77d8842784d7c08493108d009ae42cae1b.tar.gz tcl-b6a2ba77d8842784d7c08493108d009ae42cae1b.tar.bz2 |
* generic/tclCompile.c: replaced copy loop that tripped some
compilers with memmove [Bug 1780870]
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | generic/tclCompile.c | 10 |
2 files changed, 10 insertions, 5 deletions
@@ -1,3 +1,8 @@ +2007-08-24 Miguel Sofer <msofer@users.sf.net> + + * generic/tclCompile.c: replaced copy loop that tripped some + compilers with memmove [Bug 1780870] + 2007-08-23 Don Porter <dgp@users.sourceforge.net> * library/init.tcl ([auto_load_index]): Delete stray "]" that created diff --git a/generic/tclCompile.c b/generic/tclCompile.c index de7f4c2..eaf8514 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.125 2007/07/31 17:03:37 msofer Exp $ + * RCS: @(#) $Id: tclCompile.c,v 1.126 2007/08/24 11:22:51 msofer Exp $ */ #include "tclInt.h" @@ -2797,10 +2797,10 @@ TclFixupForwardJump( TclExpandCodeArray(envPtr); } jumpPc = (envPtr->codeStart + jumpFixupPtr->codeOffset); - for (numBytes = envPtr->codeNext-jumpPc-2, p = jumpPc+2+numBytes-1; - numBytes > 0; numBytes--, p--) { - p[3] = p[0]; - } + numBytes = envPtr->codeNext-jumpPc-2; + p = jumpPc+2; + memmove(p+3, p, numBytes); + envPtr->codeNext += 3; jumpDist += 3; switch (jumpFixupPtr->jumpType) { |