diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-05-10 07:50:31 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-05-10 07:50:31 (GMT) |
| commit | a2a03ea8fb6718cc472cc7dcb44f8e68aadb24ba (patch) | |
| tree | b27d28ac5054d661fb8510ac1b75127cbf036c79 /generic/tclVar.c | |
| parent | 740e938393791a7c1fe675b21ece901fa6cbdd74 (diff) | |
| parent | 216ea63416cffd9c521476d74fce958860d2acf9 (diff) | |
| download | tcl-a2a03ea8fb6718cc472cc7dcb44f8e68aadb24ba.zip tcl-a2a03ea8fb6718cc472cc7dcb44f8e68aadb24ba.tar.gz tcl-a2a03ea8fb6718cc472cc7dcb44f8e68aadb24ba.tar.bz2 | |
Merge trunk
Diffstat (limited to 'generic/tclVar.c')
| -rw-r--r-- | generic/tclVar.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/generic/tclVar.c b/generic/tclVar.c index c457be7..86b386c 100644 --- a/generic/tclVar.c +++ b/generic/tclVar.c @@ -722,7 +722,7 @@ TclObjLookupVarEx( Tcl_Obj *cachedNamePtr = localName(varFramePtr, index); if (part1Ptr == cachedNamePtr) { - cachedNamePtr = NULL; + LocalSetIntRep(part1Ptr, index, NULL); } else { /* * [80304238ac] Trickiness here. We will store and incr the @@ -735,6 +735,14 @@ TclObjLookupVarEx( * cachedNamePtr and leave it as string only. This is * radical and destructive, so a better idea would be welcome. */ + + /* + * Firstly set cached local var reference (avoid free before set, + * see [45b9faf103f2]) + */ + LocalSetIntRep(part1Ptr, index, cachedNamePtr); + + /* Then wipe it */ TclFreeIntRep(cachedNamePtr); /* @@ -744,7 +752,6 @@ TclObjLookupVarEx( */ LocalSetIntRep(cachedNamePtr, index, NULL); } - LocalSetIntRep(part1Ptr, index, cachedNamePtr); } else { /* * At least mark part1Ptr as already parsed. |
