diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-12-05 22:40:20 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-12-05 22:40:20 (GMT) |
commit | 2996ef1b03e4fac0c23ae64bb074521fc406cbef (patch) | |
tree | f017ea10cace1b90a5054a7f4726bc70f6cc9845 | |
parent | fe7f00117928ce81ae146b33181ba20a87b2584c (diff) | |
download | tcl-2996ef1b03e4fac0c23ae64bb074521fc406cbef.zip tcl-2996ef1b03e4fac0c23ae64bb074521fc406cbef.tar.gz tcl-2996ef1b03e4fac0c23ae64bb074521fc406cbef.tar.bz2 |
A demo version of "novem" in which the signature of Tcl_EvalEx is modified
to have a Tcl_WideInt numBytes argument. That's the only change.
-rw-r--r-- | generic/tcl.decls | 2 | ||||
-rw-r--r-- | generic/tclBasic.c | 7 | ||||
-rw-r--r-- | generic/tclDecls.h | 4 |
3 files changed, 8 insertions, 5 deletions
diff --git a/generic/tcl.decls b/generic/tcl.decls index ad725f5..595cb98 100644 --- a/generic/tcl.decls +++ b/generic/tcl.decls @@ -1051,7 +1051,7 @@ declare 290 { void Tcl_DiscardResult(Tcl_SavedResult *statePtr) } declare 291 { - int Tcl_EvalEx(Tcl_Interp *interp, const char *script, int numBytes, + int Tcl_EvalEx(Tcl_Interp *interp, const char *script, Tcl_WideInt numBytes, int flags) } declare 292 { diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 7202184..ee41bde 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -4442,14 +4442,17 @@ 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 + Tcl_WideInt 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); + if (numBytes < -1 || numBytes > INT_MAX) { + Tcl_Panic("Crash!"); + } + return TclEvalEx(interp, script, (int)numBytes, flags, 1, NULL, script); } int diff --git a/generic/tclDecls.h b/generic/tclDecls.h index d38296d..63dbdf1 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.h @@ -834,7 +834,7 @@ TCLAPI void Tcl_DeleteThreadExitHandler(Tcl_ExitProc *proc, TCLAPI void Tcl_DiscardResult(Tcl_SavedResult *statePtr); /* 291 */ TCLAPI int Tcl_EvalEx(Tcl_Interp *interp, const char *script, - int numBytes, int flags); + Tcl_WideInt numBytes, int flags); /* 292 */ TCLAPI int Tcl_EvalObjv(Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], int flags); @@ -2094,7 +2094,7 @@ typedef struct TclStubs { void (*tcl_CreateThreadExitHandler) (Tcl_ExitProc *proc, ClientData clientData); /* 288 */ void (*tcl_DeleteThreadExitHandler) (Tcl_ExitProc *proc, ClientData clientData); /* 289 */ void (*tcl_DiscardResult) (Tcl_SavedResult *statePtr); /* 290 */ - int (*tcl_EvalEx) (Tcl_Interp *interp, const char *script, int numBytes, int flags); /* 291 */ + int (*tcl_EvalEx) (Tcl_Interp *interp, const char *script, Tcl_WideInt numBytes, int flags); /* 291 */ int (*tcl_EvalObjv) (Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], int flags); /* 292 */ int (*tcl_EvalObjEx) (Tcl_Interp *interp, Tcl_Obj *objPtr, int flags); /* 293 */ void (*tcl_ExitThread) (int status); /* 294 */ |