diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-01-25 13:12:01 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-01-25 13:12:01 (GMT) |
commit | f7ce916401a79c8806b918f5f9d6c6079dc86a9e (patch) | |
tree | 0dca0f062ef1061979b9a7a16011c031b9c38ae9 /generic | |
parent | dce0231335d8e7d77ef10904deaf2930cc98dd7e (diff) | |
parent | 3cf091e2d8b739ba3dfaabe7e178b28abe80e00e (diff) | |
download | tcl-f7ce916401a79c8806b918f5f9d6c6079dc86a9e.zip tcl-f7ce916401a79c8806b918f5f9d6c6079dc86a9e.tar.gz tcl-f7ce916401a79c8806b918f5f9d6c6079dc86a9e.tar.bz2 |
merge trunk
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclAssembly.c | 1 | ||||
-rw-r--r-- | generic/tclCkalloc.c | 4 | ||||
-rw-r--r-- | generic/tclExecute.c | 1 | ||||
-rw-r--r-- | generic/tclIndexObj.c | 14 |
4 files changed, 13 insertions, 7 deletions
diff --git a/generic/tclAssembly.c b/generic/tclAssembly.c index 99bdf43..c4eeded 100644 --- a/generic/tclAssembly.c +++ b/generic/tclAssembly.c @@ -801,7 +801,6 @@ TclNRAssembleObjCmd( Tcl_AppendObjToErrorInfo(interp, objv[0]); Tcl_AddErrorInfo(interp, "\" body, line "); backtrace = Tcl_NewIntObj(Tcl_GetErrorLine(interp)); - Tcl_IncrRefCount(backtrace); Tcl_AppendObjToErrorInfo(interp, backtrace); Tcl_AddErrorInfo(interp, ")"); return TCL_ERROR; diff --git a/generic/tclCkalloc.c b/generic/tclCkalloc.c index ab977cb..70e64f0 100644 --- a/generic/tclCkalloc.c +++ b/generic/tclCkalloc.c @@ -156,6 +156,10 @@ TclInitDbCkalloc(void) if (!ckallocInit) { ckallocInit = 1; ckallocMutexPtr = Tcl_GetAllocMutex(); +#ifndef TCL_THREADS + /* Silence compiler warning */ + (void)ckallocMutexPtr; +#endif } } diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 479ab86..c2cef2a 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -7088,7 +7088,6 @@ TEBCresume( pc += (opnd-1); PUSH_OBJECT(Tcl_NewStringObj(bytes, length)); goto instEvalStk; - NEXT_INST_F(9, 0, 0); } } diff --git a/generic/tclIndexObj.c b/generic/tclIndexObj.c index 512f5ba..0372668 100644 --- a/generic/tclIndexObj.c +++ b/generic/tclIndexObj.c @@ -69,12 +69,12 @@ typedef struct { * The following macros greatly simplify moving through a table... */ -#define STRING_AT(table, offset, index) \ - (*((const char *const *)(((char *)(table)) + ((offset) * (index))))) +#define STRING_AT(table, offset) \ + (*((const char *const *)(((char *)(table)) + (offset)))) #define NEXT_ENTRY(table, offset) \ - (&(STRING_AT(table, offset, 1))) + (&(STRING_AT(table, offset))) #define EXPAND_OF(indexRep) \ - STRING_AT((indexRep)->tablePtr, (indexRep)->offset, (indexRep)->index) + STRING_AT((indexRep)->tablePtr, (indexRep)->offset*(indexRep)->index) /* *---------------------------------------------------------------------- @@ -238,7 +238,7 @@ GetIndexFromObjList( * a proper match, then TCL_ERROR is returned and an error message is * left in interp's result (unless interp is NULL). The msg argument is * used in the error message; for example, if msg has the value "option" - * then the error message will say something flag 'bad option "foo": must + * then the error message will say something like 'bad option "foo": must * be ...' * * Side effects: @@ -270,6 +270,10 @@ Tcl_GetIndexFromObjStruct( Tcl_Obj *resultPtr; IndexRep *indexRep; + /* Protect against invalid values, like -1 or 0. */ + if (offset < (int)sizeof(char *)) { + offset = (int)sizeof(char *); + } /* * See if there is a valid cached result from a previous lookup. */ |