diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2011-08-02 09:07:29 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2011-08-02 09:07:29 (GMT) |
commit | 48549658629032dd38411079fd36f81ca3ff56e6 (patch) | |
tree | 7b4bf1850cc6b99277550e0daf38a3f45b3ada62 | |
parent | 7cafb9729cb8db722600b80cd3b1c9536ca46519 (diff) | |
download | tcl-48549658629032dd38411079fd36f81ca3ff56e6.zip tcl-48549658629032dd38411079fd36f81ca3ff56e6.tar.gz tcl-48549658629032dd38411079fd36f81ca3ff56e6.tar.bz2 |
[Bug 3384007]: Fix some panic messages.
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | generic/tclObj.c | 46 |
2 files changed, 30 insertions, 28 deletions
@@ -1,8 +1,14 @@ +2011-08-02 Donal K. Fellows <dkf@users.sf.net> + + * generic/tclObj.c (Tcl_DbIncrRefCount, Tcl_DbDecrRefCount) + (Tcl_DbIsShared): [Bug 3384007]: Fix the panic messages so they share + what should be shared and have the right number of spaces. + 2011-08-01 Miguel Sofer <msofer@users.sf.net> - * generic/tclProc.c (TclProcCompileProc): fix for leak of - resolveInfo when recompiling procs, [Bug 3383616]. Thx go to - Gustaf Neumann for detecting the bug and providing the fix. + * generic/tclProc.c (TclProcCompileProc): [Bug 3383616]: Fix for leak + of resolveInfo when recompiling procs. Thanks go to Gustaf Neumann for + detecting the bug and providing the fix. 2011-08-01 Donal K. Fellows <dkf@users.sf.net> diff --git a/generic/tclObj.c b/generic/tclObj.c index 95924c1..a1316d9 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -3713,23 +3713,21 @@ Tcl_DbIncrRefCount( */ if (!TclInExit()) { - Tcl_HashTable *tablePtr; - Tcl_HashEntry *hPtr; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); + Tcl_HashTable *tablePtr = tsdPtr->objThreadMap; + Tcl_HashEntry *hPtr; - tablePtr = tsdPtr->objThreadMap; if (!tablePtr) { Tcl_Panic("object table not initialized"); } hPtr = Tcl_FindHashEntry(tablePtr, objPtr); if (!hPtr) { - Tcl_Panic("%s%s", - "Trying to incr ref count of ", - "Tcl_Obj allocated in another thread"); + Tcl_Panic("Trying to %s of Tcl_Obj allocated in another thread", + "incr ref count"); } } -# endif -#endif +# endif /* TCL_THREADS */ +#endif /* TCL_MEM_DEBUG */ ++(objPtr)->refCount; } @@ -3778,19 +3776,17 @@ Tcl_DbDecrRefCount( */ if (!TclInExit()) { - Tcl_HashTable *tablePtr; - Tcl_HashEntry *hPtr; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); + Tcl_HashTable *tablePtr = tsdPtr->objThreadMap; + Tcl_HashEntry *hPtr; - tablePtr = tsdPtr->objThreadMap; if (!tablePtr) { Tcl_Panic("object table not initialized"); } hPtr = Tcl_FindHashEntry(tablePtr, objPtr); if (!hPtr) { - Tcl_Panic("%s%s", - "Trying to decr ref count of ", - "Tcl_Obj allocated in another thread"); + Tcl_Panic("Trying to %s of Tcl_Obj allocated in another thread", + "decr ref count"); } /* @@ -3807,8 +3803,9 @@ Tcl_DbDecrRefCount( Tcl_DeleteHashEntry(hPtr); } } -# endif -#endif +# endif /* TCL_THREADS */ +#endif /* TCL_MEM_DEBUG */ + if (--(objPtr)->refCount <= 0) { TclFreeObj(objPtr); } @@ -3858,22 +3855,21 @@ Tcl_DbIsShared( */ if (!TclInExit()) { - Tcl_HashTable *tablePtr; - Tcl_HashEntry *hPtr; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - tablePtr = tsdPtr->objThreadMap; + Tcl_HashTable *tablePtr = tsdPtr->objThreadMap; + Tcl_HashEntry *hPtr; + if (!tablePtr) { Tcl_Panic("object table not initialized"); } hPtr = Tcl_FindHashEntry(tablePtr, objPtr); if (!hPtr) { - Tcl_Panic("%s%s", - "Trying to check shared status of", - "Tcl_Obj allocated in another thread"); + Tcl_Panic("Trying to %s of Tcl_Obj allocated in another thread", + "check shared status"); } } -# endif -#endif +# endif /* TCL_THREADS */ +#endif /* TCL_MEM_DEBUG */ #ifdef TCL_COMPILE_STATS Tcl_MutexLock(&tclObjMutex); @@ -3885,7 +3881,7 @@ Tcl_DbIsShared( tclObjsShared[0]++; } Tcl_MutexUnlock(&tclObjMutex); -#endif +#endif /* TCL_COMPILE_STATS */ return ((objPtr)->refCount > 1); } |