summaryrefslogtreecommitdiffstats
path: root/generic/tclBasic.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclBasic.c')
-rw-r--r--generic/tclBasic.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index 3427dff..4daece7 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -482,13 +482,9 @@ Tcl_CreateInterp(void)
iPtr = ckalloc(sizeof(Interp));
interp = (Tcl_Interp *) iPtr;
- iPtr->legacyResult = NULL;
- /* Special invalid value: Any attempt to free the legacy result
- * will cause a crash. */
- iPtr->legacyFreeProc = (void (*) (void))-1;
+ iPtr->objResultPtr = Tcl_NewObj();
iPtr->errorLine = 0;
iPtr->stubTable = &tclStubs;
- iPtr->objResultPtr = Tcl_NewObj();
Tcl_IncrRefCount(iPtr->objResultPtr);
iPtr->handle = TclHandleCreate(iPtr);
iPtr->globalNsPtr = NULL;
@@ -4442,14 +4438,18 @@ Tcl_EvalEx(
Tcl_Interp *interp, /* Interpreter in which to evaluate the
* script. Also used for error reporting. */
const char *script, /* First character of script to evaluate. */
- int numBytes, /* Number of bytes in script. If < 0, the
+ size_t numBytes, /* Number of bytes in script. If < 0, the
* script consists of all bytes up to the
* first null character. */
int flags) /* Collection of OR-ed bits that control the
* evaluation of the script. Only
* TCL_EVAL_GLOBAL is currently supported. */
{
- return TclEvalEx(interp, script, numBytes, flags, 1, NULL, script);
+ /* TODO: remove in final implementation */
+ if ((numBytes + 1) >= INT_MAX) {
+ Tcl_Panic("Tcl_EvalEx: overflow in numBytes");
+ }
+ return TclEvalEx(interp, script, (int)numBytes, flags, 1, NULL, script);
}
int