summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2013-01-04 11:14:59 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2013-01-04 11:14:59 (GMT)
commit8ccae052467b3b4ef6a42321289d1a8535c858d5 (patch)
treea2ed642c38ff21ba7fd8a3a8b25f0407daa58114
parentaa5bfc6d5bbe02732c290215d4f69c1f1ce37dda (diff)
parent09d1473b3be04898d6ec67abcad0b980fdd88df6 (diff)
downloadtcl-8ccae052467b3b4ef6a42321289d1a8535c858d5.zip
tcl-8ccae052467b3b4ef6a42321289d1a8535c858d5.tar.gz
tcl-8ccae052467b3b4ef6a42321289d1a8535c858d5.tar.bz2
merge trunk
-rw-r--r--ChangeLog31
-rw-r--r--doc/CrtChannel.34
-rw-r--r--doc/fconfigure.n4
-rw-r--r--generic/tclExecute.c14
-rw-r--r--generic/tclInt.h1
-rw-r--r--generic/tclUtil.c4
6 files changed, 45 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 09a0199..90a10a6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,24 @@
+2013-01-04 Donal K. Fellows <dkf@users.sf.net>
+
+ * generic/tclEnsemble.c (CompileBasicNArgCommand): Added very simple
+ compiler (which just compiles to a normal invoke of the implementation
+ command) for many ensemble subcommands where we can prove that there
+ is no way for scripts to detect the difference even through error
+ handling or [info level]/[info frame]. This improves the code produced
+ from some ensembles (e.g., [info], [string]) to the point where the
+ ensemble is now not normally seen at the bytecode level at all.
+
+2013-01-04 Miguel Sofer <msofer@users.sf.net>
+
+ * generic/tclInt.h: Insure that PURIFY builds cannot exploit the
+ * generic/tclExecute.c: Tcl stack to hide mem defects.
+
2013-01-03 Donal K. Fellows <dkf@users.sf.net>
+ * doc/fconfigure.n, doc/CrtChannel.3: Updated to reflect the fact that
+ the minimum buffer size is one byte, not ten. Identified by Schelte
+ Bron on the Tcler's Chat.
+
* generic/tclExecute.c (TEBCresume:INST_INVOKE_REPLACE):
* generic/tclEnsemble.c (TclCompileEnsemble): Added new mechanism to
allow for more efficient dispatch of non-bytecode-compiled subcommands
@@ -8,9 +27,9 @@
2013-01-02 Miguel Sofer <msofer@users.sf.net>
- * generic/tclEnsemble.c: Remove stray calls to Tcl_Alloc and
- * generic/tclExecute.c: friends: the core should only use ckalloc
- * generic/tclIORTrans.c: to allow MEM_DEBUG to work properly
+ * generic/tclEnsemble.c: Remove stray calls to Tcl_Alloc and friends:
+ * generic/tclExecute.c: the core should only use ckalloc to allow
+ * generic/tclIORTrans.c: MEM_DEBUG to work properly.
* generic/tclTomMathInterface.c:
2012-12-31 Donal K. Fellows <dkf@users.sf.net>
@@ -22,7 +41,7 @@
2012-12-27 Jan Nijtmans <nijtmans@users.sf.net>
* generic/tclListObj.c: [Bug 3598580]: Tcl_ListObjReplace may release
- deleted elements too early
+ deleted elements too early.
2012-12-22 Alexandre Ferrieux <ferrieux@users.sourceforge.net>
@@ -32,8 +51,8 @@
2012-12-21 Jan Nijtmans <nijtmans@users.sf.net>
* unix/dltest/pkgb.c: Inline compat Tcl_GetDefaultEncodingDir.
- * generic/tclStubLib.c: Eliminate unnecessary static HasStubSupport() and
- isDigit() functions, just do the same inline.
+ * generic/tclStubLib.c: Eliminate unnecessary static HasStubSupport()
+ and isDigit() functions, just do the same inline.
2012-12-18 Donal K. Fellows <dkf@users.sf.net>
diff --git a/doc/CrtChannel.3 b/doc/CrtChannel.3
index 55a4024..57bb76e 100644
--- a/doc/CrtChannel.3
+++ b/doc/CrtChannel.3
@@ -250,8 +250,8 @@ the default value of 4096 is returned.
.PP
\fBTcl_SetChannelBufferSize\fR sets the size, in bytes, of buffers that
will be allocated in subsequent operations on the channel to store input or
-output. The \fIsize\fR argument should be between ten and one million,
-allowing buffers of ten bytes to one million bytes. If \fIsize\fR is
+output. The \fIsize\fR argument should be between one and one million,
+allowing buffers of one byte to one million bytes. If \fIsize\fR is
outside this range, \fBTcl_SetChannelBufferSize\fR sets the buffer size to
4096.
.PP
diff --git a/doc/fconfigure.n b/doc/fconfigure.n
index ac0366c..550d071 100644
--- a/doc/fconfigure.n
+++ b/doc/fconfigure.n
@@ -72,8 +72,8 @@ initially set to \fBline\fR, and \fBstderr\fR is set to \fBnone\fR.
.
\fINewvalue\fR must be an integer; its value is used to set the size of
buffers, in bytes, subsequently allocated for this channel to store input
-or output. \fINewvalue\fR must be between ten and one million, allowing
-buffers of ten to one million bytes in size.
+or output. \fINewvalue\fR must be between one and one million, allowing
+buffers of one to one million bytes in size.
.TP
\fB\-encoding\fR \fIname\fR
.
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 9fcc8a5..3635bab 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -1048,6 +1048,7 @@ GrowEvaluationStack(
return MEMSTART(markerPtr);
}
} else {
+#ifndef PURIFY
Tcl_Obj **tmpMarkerPtr = esPtr->tosPtr + 1;
int offset = OFFSET(tmpMarkerPtr);
@@ -1064,6 +1065,7 @@ GrowEvaluationStack(
*esPtr->markerPtr = (Tcl_Obj *) markerPtr;
return memStart;
}
+#endif
}
/*
@@ -1075,8 +1077,9 @@ GrowEvaluationStack(
if (move) {
moveWords = esPtr->tosPtr - MEMSTART(markerPtr) + 1;
}
- needed = growth + moveWords + WALLOCALIGN;
+ needed = growth + moveWords + WALLOCALIGN - 1;
+
/*
* Check if there is enough room in the next stack (if there is one, it
* should be both empty and the last one!)
@@ -1106,10 +1109,15 @@ GrowEvaluationStack(
* including the elements to be copied over and the new marker.
*/
+#ifndef PURIFY
newElems = 2*currElems;
while (needed > newElems) {
newElems *= 2;
}
+#else
+ newElems = needed;
+#endif
+
newBytes = sizeof(ExecStack) + (newElems-1) * sizeof(Tcl_Obj *);
oldPtr = esPtr;
@@ -1258,6 +1266,10 @@ TclStackFree(
}
if (esPtr->prevPtr) {
eePtr->execStackPtr = esPtr->prevPtr;
+#ifdef PURIFY
+ eePtr->execStackPtr->nextPtr = NULL;
+ DeleteExecStack(esPtr);
+#endif
} else {
eePtr->execStackPtr = esPtr;
}
diff --git a/generic/tclInt.h b/generic/tclInt.h
index f308a67..537afb3 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -4050,6 +4050,7 @@ typedef const char *TclDTraceStr;
ckfree((char *) (objPtr))
#undef USE_THREAD_ALLOC
+#undef USE_TCLALLOC
#elif defined(TCL_THREADS) && defined(USE_THREAD_ALLOC)
/*
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index ddf067b..27e2474 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.c
@@ -167,7 +167,7 @@ const Tcl_ObjType tclEndOffsetType = {
* separating whitespace, or a string terminator. It is just another
* character in a list element.
*
- * The interpretaton of a formatted substring as a list element follows rules
+ * The interpretation of a formatted substring as a list element follows rules
* similar to the parsing of the words of a command in a Tcl script. Backslash
* substitution plays a key role, and is defined exactly as it is in command
* parsing. The same routine, TclParseBackslash() is used in both command
@@ -179,7 +179,7 @@ const Tcl_ObjType tclEndOffsetType = {
* Backslash substitution replaces an "escape sequence" of one or more
* characters starting with
* \u005c \ BACKSLASH
- * with a single character. The one character escape sequent case happens only
+ * with a single character. The one character escape sequence case happens only
* when BACKSLASH is the last character in the string. In all other cases, the
* escape sequence is at least two characters long.
*