5070
5085
* internal rep).
5073
if (objPtr->typePtr == &tclListType) { /* is a list... */
5074
List *listRepPtr = objPtr->internalRep.twoPtrValue.ptr1;
5076
if (objPtr->bytes == NULL || /* ...without a string rep */
5077
listRepPtr->canonicalFlag) {/* ...or that is canonical */
5079
* TIP #280 Structures for tracking lines. As we know that this is
5080
* dynamic execution we ignore the invoker, even if known.
5084
Tcl_Obj **elements, *copyPtr = TclListObjCopy(NULL, objPtr);
5085
CmdFrame *eoFramePtr = (CmdFrame *)
5088
if (TclListObjIsCanonical(objPtr)) {
5090
* TIP #280 Structures for tracking lines. As we know that this is
5091
* dynamic execution we ignore the invoker, even if known.
5095
Tcl_Obj **elements, *copyPtr = TclListObjCopy(NULL, objPtr);
5096
CmdFrame *eoFramePtr = (CmdFrame *)
5086
5097
TclStackAlloc(interp, sizeof(CmdFrame));
5088
eoFramePtr->type = TCL_LOCATION_EVAL_LIST;
5089
eoFramePtr->level = (iPtr->cmdFramePtr == NULL?
5090
1 : iPtr->cmdFramePtr->level + 1);
5091
eoFramePtr->framePtr = iPtr->framePtr;
5092
eoFramePtr->nextPtr = iPtr->cmdFramePtr;
5094
eoFramePtr->nline = 0;
5095
eoFramePtr->line = NULL;
5097
eoFramePtr->cmd.listPtr = objPtr;
5098
Tcl_IncrRefCount(eoFramePtr->cmd.listPtr);
5099
eoFramePtr->data.eval.path = NULL;
5102
* TIP #280 We do _not_ compute all the line numbers for the words
5103
* in the command. For the eval of a pure list the most sensible
5104
* choice is to put all words on line 1. Given that we neither
5105
* need memory for them nor compute anything. 'line' is left
5106
* NULL. The two places using this information (TclInfoFrame, and
5107
* TclInitCompileEnv), are special-cased to use the proper line
5108
* number directly instead of accessing the 'line' array.
5111
Tcl_ListObjGetElements(NULL, copyPtr,
5112
&nelements, &elements);
5114
iPtr->cmdFramePtr = eoFramePtr;
5115
result = Tcl_EvalObjv(interp, nelements, elements,
5118
Tcl_DecrRefCount(copyPtr);
5119
iPtr->cmdFramePtr = iPtr->cmdFramePtr->nextPtr;
5120
Tcl_DecrRefCount(eoFramePtr->cmd.listPtr);
5121
TclStackFree(interp, eoFramePtr);
5127
if (flags & TCL_EVAL_DIRECT) {
5099
eoFramePtr->type = TCL_LOCATION_EVAL_LIST;
5100
eoFramePtr->level = (iPtr->cmdFramePtr == NULL? 1
5101
: iPtr->cmdFramePtr->level + 1);
5102
eoFramePtr->framePtr = iPtr->framePtr;
5103
eoFramePtr->nextPtr = iPtr->cmdFramePtr;
5105
eoFramePtr->nline = 0;
5106
eoFramePtr->line = NULL;
5108
eoFramePtr->cmd.listPtr = objPtr;
5109
Tcl_IncrRefCount(eoFramePtr->cmd.listPtr);
5110
eoFramePtr->data.eval.path = NULL;
5113
* TIP #280 We do _not_ compute all the line numbers for the words
5114
* in the command. For the eval of a pure list the most sensible
5115
* choice is to put all words on line 1. Given that we neither
5116
* need memory for them nor compute anything. 'line' is left
5117
* NULL. The two places using this information (TclInfoFrame, and
5118
* TclInitCompileEnv), are special-cased to use the proper line
5119
* number directly instead of accessing the 'line' array.
5122
Tcl_ListObjGetElements(NULL, copyPtr, &nelements, &elements);
5124
iPtr->cmdFramePtr = eoFramePtr;
5125
result = Tcl_EvalObjv(interp, nelements, elements, flags);
5127
Tcl_DecrRefCount(copyPtr);
5128
iPtr->cmdFramePtr = iPtr->cmdFramePtr->nextPtr;
5129
Tcl_DecrRefCount(eoFramePtr->cmd.listPtr);
5130
TclStackFree(interp, eoFramePtr);
5131
} else if (flags & TCL_EVAL_DIRECT) {
5129
5133
* We're not supposed to use the compiler or byte-code interpreter.
5130
5134
* Let Tcl_EvalEx evaluate the command directly (and probably more