From: Donal K. F. <don...@ma...> - 2010-02-01 13:12:19
|
On 01/02/2010 13:06, Alexandre Ferrieux wrote: > (1) Am I allowed to commit the following 1-line addition to tclVar.c: > > @@ -5610,6 +5624,7 @@ FreeVarEntry( > > if (TclIsVarUndefined(varPtr)&& !TclIsVarTraced(varPtr) > && (VarHashRefCount(varPtr) == 1)) { > + varPtr->value.objPtr=(void *)0xdeadbeef; > ckfree((char *) varPtr); > } else { > VarHashInvalidateEntry(varPtr); > > Rationale: it makes more reliable any time-bomb-like crash related to > nasty reentrant trace issues like 2939073. Allows my fix for this bug > to contain a test case. I'd be more inclined to put a NULL in there so that we're making the clear statement that this memory cell isn't pointing to anything. YMMV. > (2) What about reusing the same idea in other areas as well ? > (3) What about obj->typePtr itself ? Again, I'd be inclined to go with using NULL. But there's nothing wrong at all with doing this stuff. Well, so long as we make sure all the problems associated with it go away afterwards, but it's for finding those things that we'd consider doing this in the first place. :-) Donal. |