From d1ba3dff8f0b5e1ca46bd9588f225c4dd882f87c Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 30 May 2013 18:51:44 +0000 Subject: More robust expansion calculation. Look Ma! No operand! --- generic/tclExecute.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 7c645e7..426364d 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -2715,6 +2715,7 @@ TEBCresume( TclNewObj(objPtr); objPtr->internalRep.ptrAndLongRep.value = CURR_DEPTH; + objPtr->length = 0; PUSH_TAUX_OBJ(objPtr); NEXT_INST_F(1, 0, 0); @@ -2743,7 +2744,14 @@ TEBCresume( * stack depth, as seen by the compiler. */ + auxObjList->length += objc; + +/* length = objc + (codePtr->maxStackDepth - TclGetInt4AtPtr(pc+1)); +*/ + length = auxObjList->length /* Total expansion room we need */ + + codePtr->maxStackDepth /* Beyond the original max */ + - CURR_DEPTH; /* Relative to where we are */ DECACHE_STACK_INFO(); moved = GrowEvaluationStack(iPtr->execEnvPtr, length, 1) - (Tcl_Obj **) TD; -- cgit v0.12