summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-11-24 20:31:42 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-11-24 20:31:42 (GMT)
commit5f291bc906e3c9230fc9b9014ad34d9cae439708 (patch)
tree5fccd486a6b82b6482b0cb2e701b7f58849796fb
parent2290210ff1e4282f665fd6b6dfaf4142220f5559 (diff)
parent5e9f62442819a26249ffe7584158ee47fa974cc9 (diff)
downloadtcl-5f291bc906e3c9230fc9b9014ad34d9cae439708.zip
tcl-5f291bc906e3c9230fc9b9014ad34d9cae439708.tar.gz
tcl-5f291bc906e3c9230fc9b9014ad34d9cae439708.tar.bz2
merge trunk
-rw-r--r--generic/tclBasic.c2
-rw-r--r--generic/tclDisassemble.c18
-rw-r--r--generic/tclStringObj.c2
3 files changed, 11 insertions, 11 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index d7e9fb3..19c9829 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -569,7 +569,7 @@ Tcl_CreateInterp(void)
iPtr->cmdCount = 0;
TclInitLiteralTable(&iPtr->literalTable);
- iPtr->compileEpoch = 0;
+ iPtr->compileEpoch = 1;
iPtr->compiledProcPtr = NULL;
iPtr->resolverPtr = NULL;
iPtr->evalFlags = 0;
diff --git a/generic/tclDisassemble.c b/generic/tclDisassemble.c
index ff0351a..0b1a4ad 100644
--- a/generic/tclDisassemble.c
+++ b/generic/tclDisassemble.c
@@ -254,7 +254,7 @@ DisassembleByteCodeObj(
int codeOffset, codeLen, srcOffset, srcLen, numCmds, delta, i, line;
Interp *iPtr = (Interp *) *codePtr->interpHandle;
Tcl_Obj *bufferObj, *fileObj;
- char ptrBuf1[20], ptrBuf2[20];
+ char buf[128];
TclNewObj(bufferObj);
if (codePtr->refCount <= 0) {
@@ -269,12 +269,12 @@ DisassembleByteCodeObj(
* Print header lines describing the ByteCode.
*/
- sprintf(ptrBuf1, "%p", codePtr);
- sprintf(ptrBuf2, "%p", iPtr);
- Tcl_AppendPrintfToObj(bufferObj,
- "ByteCode 0x%s, refCt %" TCL_LL_MODIFIER "u, epoch %" TCL_LL_MODIFIER "u, interp 0x%s (epoch %" TCL_LL_MODIFIER "u)\n",
- ptrBuf1, (Tcl_WideInt)codePtr->refCount, (Tcl_WideInt)codePtr->compileEpoch, ptrBuf2,
+ sprintf(buf,
+ "%p, refCt %" TCL_LL_MODIFIER "u, epoch %" TCL_LL_MODIFIER "u, "
+ "interp 0x%p (epoch %" TCL_LL_MODIFIER "u",
+ codePtr, (Tcl_WideInt)codePtr->refCount, (Tcl_WideInt)codePtr->compileEpoch, iPtr,
(Tcl_WideInt)iPtr->compileEpoch);
+ Tcl_AppendPrintfToObj(bufferObj, "ByteCode 0x%s)\n", buf);
Tcl_AppendToObj(bufferObj, " Source ", -1);
PrintSourceToObj(bufferObj, codePtr->source,
TclMin(codePtr->numSrcBytes, 55));
@@ -316,10 +316,10 @@ DisassembleByteCodeObj(
Proc *procPtr = codePtr->procPtr;
int numCompiledLocals = procPtr->numCompiledLocals;
- sprintf(ptrBuf1, "%p", procPtr);
+ sprintf(buf, "%p, refCt %" TCL_LL_MODIFIER "u", procPtr, (Tcl_WideInt) procPtr->refCount);
Tcl_AppendPrintfToObj(bufferObj,
- " Proc 0x%s, refCt %d, args %d, compiled locals %d\n",
- ptrBuf1, procPtr->refCount, procPtr->numArgs,
+ " Proc 0x%s, args %d, compiled locals %d\n",
+ buf, procPtr->numArgs,
numCompiledLocals);
if (numCompiledLocals > 0) {
CompiledLocal *localPtr = procPtr->firstLocalPtr;
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index 7abebb3..5cfa2f6 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -3444,7 +3444,7 @@ ExtendStringRepWithUnicode(
goto copyBytes;
}
- for (i = 0; i < numChars && size >= 0; i++) {
+ for (i = 0; i < numChars; i++) {
size += TclUtfCount(unicode[i]);
}
if ((int)size < 0) {