summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tclAssembly.c14
-rw-r--r--generic/tclCompile.c6
-rw-r--r--generic/tclCompile.h26
-rw-r--r--generic/tclDisassemble.c6
-rw-r--r--generic/tclEnsemble.c2
-rw-r--r--generic/tclExecute.c11
6 files changed, 33 insertions, 32 deletions
diff --git a/generic/tclAssembly.c b/generic/tclAssembly.c
index 4458e59..3abd4fa 100644
--- a/generic/tclAssembly.c
+++ b/generic/tclAssembly.c
@@ -965,7 +965,7 @@ TclCompileAssembleCmd(
size_t numCommands = envPtr->numCommands;
int offset = envPtr->codeNext - envPtr->codeStart;
- int depth = envPtr->currStackDepth;
+ size_t depth = envPtr->currStackDepth;
/*
* Make sure that the command has a single arg that is a simple word.
*/
@@ -1811,8 +1811,8 @@ CompileEmbeddedScript(
* code.
*/
- int savedStackDepth = envPtr->currStackDepth;
- int savedMaxStackDepth = envPtr->maxStackDepth;
+ size_t savedStackDepth = envPtr->currStackDepth;
+ size_t savedMaxStackDepth = envPtr->maxStackDepth;
int savedExceptArrayNext = envPtr->exceptArrayNext;
envPtr->currStackDepth = 0;
@@ -3334,7 +3334,7 @@ CheckStack(
*/
maxDepth = assemEnvPtr->maxDepth + envPtr->currStackDepth;
- if (maxDepth > envPtr->maxStackDepth) {
+ if (maxDepth > (int)envPtr->maxStackDepth) {
envPtr->maxStackDepth = maxDepth;
}
@@ -4126,8 +4126,8 @@ StackFreshCatches(
TclCreateExceptRange(CATCH_EXCEPTION_RANGE, envPtr);
range = envPtr->exceptArrayPtr + catchIndices[catchDepth];
range->nestingLevel = envPtr->exceptDepth + catchDepth;
- envPtr->maxExceptDepth =
- TclMax(range->nestingLevel + 1, envPtr->maxExceptDepth);
+ envPtr->maxExceptDepth=
+ TclMax(range->nestingLevel + 1, (int)envPtr->maxExceptDepth);
range->codeOffset = bbPtr->startOffset;
entryPtr = Tcl_FindHashEntry(&assemEnvPtr->labelHash,
@@ -4190,7 +4190,7 @@ RestoreEmbeddedExceptionRanges(
range->nestingLevel += envPtr->exceptDepth + bbPtr->catchDepth;
memcpy(envPtr->exceptArrayPtr + rangeIndex, range,
sizeof(ExceptionRange));
- if (range->nestingLevel >= envPtr->maxExceptDepth) {
+ if (range->nestingLevel >= (int)envPtr->maxExceptDepth) {
envPtr->maxExceptDepth = range->nestingLevel + 1;
}
}
diff --git a/generic/tclCompile.c b/generic/tclCompile.c
index f998aa1..a5af54e 100644
--- a/generic/tclCompile.c
+++ b/generic/tclCompile.c
@@ -3560,7 +3560,7 @@ TclCleanupStackForBreakContinue(
while (toPop --> 0) {
TclEmitOpcode(INST_EXPAND_DROP, envPtr);
}
- TclAdjustStackDepth(auxPtr->expandTargetDepth - envPtr->currStackDepth,
+ TclAdjustStackDepth((int)(auxPtr->expandTargetDepth - envPtr->currStackDepth),
envPtr);
envPtr->currStackDepth = auxPtr->expandTargetDepth;
}
@@ -4161,7 +4161,7 @@ TclEmitInvoke(
&auxContinuePtr);
if (rangePtr == NULL || rangePtr->type != LOOP_EXCEPTION_RANGE) {
auxContinuePtr = NULL;
- } else if (auxContinuePtr->stackDepth == envPtr->currStackDepth-wordCount
+ } else if (auxContinuePtr->stackDepth == (int)envPtr->currStackDepth-wordCount
&& auxContinuePtr->expandTarget == envPtr->expandCount-expandCount) {
auxContinuePtr = NULL;
} else {
@@ -4172,7 +4172,7 @@ TclEmitInvoke(
if (rangePtr == NULL || rangePtr->type != LOOP_EXCEPTION_RANGE) {
auxBreakPtr = NULL;
} else if (auxContinuePtr == NULL
- && auxBreakPtr->stackDepth == envPtr->currStackDepth-wordCount
+ && auxBreakPtr->stackDepth == (int)envPtr->currStackDepth-wordCount
&& auxBreakPtr->expandTarget == envPtr->expandCount-expandCount) {
auxBreakPtr = NULL;
} else {
diff --git a/generic/tclCompile.h b/generic/tclCompile.h
index 1dada0e..5f906ac 100644
--- a/generic/tclCompile.h
+++ b/generic/tclCompile.h
@@ -297,14 +297,14 @@ typedef struct CompileEnv {
* information provided by ObjInterpProc in
* tclProc.c. */
size_t numCommands; /* Number of commands compiled. */
- int exceptDepth; /* Current exception range nesting level; -1
+ size_t exceptDepth; /* Current exception range nesting level; -1
* if not in any range currently. */
- int maxExceptDepth; /* Max nesting level of exception ranges; -1
+ size_t maxExceptDepth; /* Max nesting level of exception ranges; -1
* if no ranges have been compiled. */
- int maxStackDepth; /* Maximum number of stack elements needed to
+ size_t maxStackDepth; /* Maximum number of stack elements needed to
* execute the code. Set by compilation
* procedures before returning. */
- int currStackDepth; /* Current stack depth. */
+ size_t currStackDepth; /* Current stack depth. */
LiteralTable localLitTable; /* Contains LiteralEntry's describing all Tcl
* objects referenced by this compiled code.
* Indexed by the string representations of
@@ -467,9 +467,9 @@ typedef struct ByteCode {
size_t numAuxDataItems; /* Number of AuxData items. */
size_t numCmdLocBytes; /* Number of bytes needed for encoded command
* location information. */
- int maxExceptDepth; /* Maximum nesting level of ExceptionRanges;
+ size_t maxExceptDepth; /* Maximum nesting level of ExceptionRanges;
* -1 if no ranges were compiled. */
- int maxStackDepth; /* Maximum number of stack elements needed to
+ size_t maxStackDepth; /* Maximum number of stack elements needed to
* execute the code. */
unsigned char *codeStart; /* Points to the first byte of the code. This
* is just after the final ByteCode member
@@ -1241,7 +1241,7 @@ MODULE_SCOPE int TclPushProcCallFrame(void *clientData,
#define TclAdjustStackDepth(delta, envPtr) \
do { \
if ((delta) < 0) { \
- if ((envPtr)->maxStackDepth < (envPtr)->currStackDepth) { \
+ if ((int)(envPtr)->maxStackDepth < (int)(envPtr)->currStackDepth) { \
(envPtr)->maxStackDepth = (envPtr)->currStackDepth; \
} \
} \
@@ -1257,9 +1257,9 @@ MODULE_SCOPE int TclPushProcCallFrame(void *clientData,
#define TclCheckStackDepth(depth, envPtr) \
do { \
size_t _dd = (depth); \
- if (_dd != (size_t)(envPtr)->currStackDepth) { \
+ if (_dd != (envPtr)->currStackDepth) { \
Tcl_Panic("bad stack depth computations: is %" TCL_Z_MODIFIER "u, should be %" TCL_Z_MODIFIER "u", \
- (size_t)(envPtr)->currStackDepth, _dd); \
+ (envPtr)->currStackDepth, _dd); \
} \
} while (0)
@@ -1576,15 +1576,15 @@ MODULE_SCOPE int TclPushProcCallFrame(void *clientData,
* of LOOP ranges is an interesting datum for debugging purposes, and that is
* what we compute now.
*
- * static int ExceptionRangeStarts(CompileEnv *envPtr, int index);
- * static void ExceptionRangeEnds(CompileEnv *envPtr, int index);
- * static void ExceptionRangeTarget(CompileEnv *envPtr, int index, LABEL);
+ * static int ExceptionRangeStarts(CompileEnv *envPtr, size_t index);
+ * static void ExceptionRangeEnds(CompileEnv *envPtr, size_t index);
+ * static void ExceptionRangeTarget(CompileEnv *envPtr, size_t index, LABEL);
*/
#define ExceptionRangeStarts(envPtr, index) \
(((envPtr)->exceptDepth++), \
((envPtr)->maxExceptDepth = \
- TclMax((envPtr)->exceptDepth, (envPtr)->maxExceptDepth)), \
+ TclMax((int)(envPtr)->exceptDepth, (int)(envPtr)->maxExceptDepth)), \
((envPtr)->exceptArrayPtr[(index)].codeOffset= CurrentOffset(envPtr)))
#define ExceptionRangeEnds(envPtr, index) \
(((envPtr)->exceptDepth--), \
diff --git a/generic/tclDisassemble.c b/generic/tclDisassemble.c
index ec0836a..cf8a154 100644
--- a/generic/tclDisassemble.c
+++ b/generic/tclDisassemble.c
@@ -288,7 +288,7 @@ DisassembleByteCodeObj(
TclGetString(fileObj), line);
}
Tcl_AppendPrintfToObj(bufferObj,
- "\n Cmds %d, src %" TCL_Z_MODIFIER "u, inst %" TCL_Z_MODIFIER "u, litObjs %" TCL_Z_MODIFIER "u, aux %" TCL_Z_MODIFIER "u, stkDepth %u, code/src %.2f\n",
+ "\n Cmds %d, src %" TCL_Z_MODIFIER "u, inst %" TCL_Z_MODIFIER "u, litObjs %" TCL_Z_MODIFIER "u, aux %" TCL_Z_MODIFIER "u, stkDepth %" TCL_Z_MODIFIER "u, code/src %.2f\n",
numCmds, codePtr->numSrcBytes, codePtr->numCodeBytes,
codePtr->numLitObjects, codePtr->numAuxDataItems,
codePtr->maxStackDepth,
@@ -352,7 +352,7 @@ DisassembleByteCodeObj(
*/
if ((int)codePtr->numExceptRanges > 0) {
- Tcl_AppendPrintfToObj(bufferObj, " Exception ranges %" TCL_Z_MODIFIER "u, depth %d:\n",
+ Tcl_AppendPrintfToObj(bufferObj, " Exception ranges %" TCL_Z_MODIFIER "u, depth %" TCL_Z_MODIFIER "u:\n",
codePtr->numExceptRanges, codePtr->maxExceptDepth);
for (i = 0; i < (int)codePtr->numExceptRanges; i++) {
ExceptionRange *rangePtr = &codePtr->exceptArrayPtr[i];
@@ -1232,7 +1232,7 @@ DisassembleByteCodeAsDicts(
Tcl_DictObjPut(NULL, description, Tcl_NewStringObj("commands", -1),
commands);
Tcl_DictObjPut(NULL, description, Tcl_NewStringObj("script", -1),
- Tcl_NewStringObj(codePtr->source, (int)codePtr->numSrcBytes));
+ Tcl_NewStringObj(codePtr->source, codePtr->numSrcBytes));
Tcl_DictObjPut(NULL, description, Tcl_NewStringObj("namespace", -1),
Tcl_NewStringObj(codePtr->nsPtr->fullName, -1));
Tcl_DictObjPut(NULL, description, Tcl_NewStringObj("stackdepth", -1),
diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c
index de9ec61..3c6af3f 100644
--- a/generic/tclEnsemble.c
+++ b/generic/tclEnsemble.c
@@ -3255,7 +3255,7 @@ TclAttemptCompileProc(
int savedAuxDataArrayNext = envPtr->auxDataArrayNext;
size_t savedExceptArrayNext = envPtr->exceptArrayNext;
#ifdef TCL_COMPILE_DEBUG
- int savedExceptDepth = envPtr->exceptDepth;
+ size_t savedExceptDepth = envPtr->exceptDepth;
#endif
if (cmdPtr->compileProc == NULL) {
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 19cf65f..d920f2d 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -638,7 +638,7 @@ static ExceptionRange * GetExceptRangeForPc(const unsigned char *pc,
static const char * GetSrcInfoForPc(const unsigned char *pc,
ByteCode *codePtr, size_t *lengthPtr,
const unsigned char **pcBeg, int *cmdIdxPtr);
-static Tcl_Obj ** GrowEvaluationStack(ExecEnv *eePtr, int growth,
+static Tcl_Obj ** GrowEvaluationStack(ExecEnv *eePtr, size_t growth,
int move);
static void IllegalExprOperandType(Tcl_Interp *interp,
const unsigned char *pc, Tcl_Obj *opndPtr);
@@ -975,12 +975,13 @@ static Tcl_Obj **
GrowEvaluationStack(
ExecEnv *eePtr, /* Points to the ExecEnv with an evaluation
* stack to enlarge. */
- int growth, /* How much larger than the current used
+ size_t growth1, /* How much larger than the current used
* size. */
int move) /* 1 if move words since last marker. */
{
ExecStack *esPtr = eePtr->execStackPtr, *oldPtr = NULL;
size_t newBytes;
+ int growth = growth1;
int newElems, currElems, needed = growth - (esPtr->endPtr - esPtr->tosPtr);
Tcl_Obj **markerPtr = esPtr->markerPtr, **memStart;
int moveWords = 0;
@@ -1888,10 +1889,10 @@ TclNRExecuteByteCode(
{
Interp *iPtr = (Interp *) interp;
TEBCdata *TD;
- int size = sizeof(TEBCdata) - 1
+ size_t size = sizeof(TEBCdata) - 1
+ (codePtr->maxStackDepth + codePtr->maxExceptDepth)
* sizeof(void *);
- int numWords = (size + sizeof(Tcl_Obj *) - 1) / sizeof(Tcl_Obj *);
+ size_t numWords = (size + sizeof(Tcl_Obj *) - 1) / sizeof(Tcl_Obj *);
TclPreserveByteCode(codePtr);
@@ -8681,7 +8682,7 @@ PrintByteCodeInfo(
fprintf(stdout, " Source: ");
TclPrintSource(stdout, codePtr->source, 60);
- fprintf(stdout, "\n Cmds %" TCL_Z_MODIFIER "u, src %" TCL_Z_MODIFIER "u, inst %" TCL_Z_MODIFIER "u, litObjs %" TCL_Z_MODIFIER "u, aux %" TCL_Z_MODIFIER "u, stkDepth %d, code/src %.2f\n",
+ fprintf(stdout, "\n Cmds %" TCL_Z_MODIFIER "u, src %" TCL_Z_MODIFIER "u, inst %" TCL_Z_MODIFIER "u, litObjs %" TCL_Z_MODIFIER "u, aux %" TCL_Z_MODIFIER "u, stkDepth %" TCL_Z_MODIFIER "u, code/src %.2f\n",
codePtr->numCommands, codePtr->numSrcBytes,
codePtr->numCodeBytes, codePtr->numLitObjects,
codePtr->numAuxDataItems, codePtr->maxStackDepth,