diff options
author | Miguel Sofer <miguel.sofer@gmail.com> | 2001-12-07 13:55:59 (GMT) |
---|---|---|
committer | Miguel Sofer <miguel.sofer@gmail.com> | 2001-12-07 13:55:59 (GMT) |
commit | e69719ee4125cc09779401e3dda6c4b67651d382 (patch) | |
tree | be9d02ee7c40c6fd4919fc83c406315d3807c43d /tests | |
parent | 6425a01b7a2896172c65f9883f0b56792a6fd263 (diff) | |
download | tcl-e69719ee4125cc09779401e3dda6c4b67651d382.zip tcl-e69719ee4125cc09779401e3dda6c4b67651d382.tar.gz tcl-e69719ee4125cc09779401e3dda6c4b67651d382.tar.bz2 |
restored consistency in refCount accounting by array traces [Bug #4484339]
Diffstat (limited to 'tests')
-rw-r--r-- | tests/trace.test | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/trace.test b/tests/trace.test index beab9c6..6a5cc88 100644 --- a/tests/trace.test +++ b/tests/trace.test @@ -11,7 +11,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: trace.test,v 1.15 2001/12/05 20:43:58 msofer Exp $ +# RCS: @(#) $Id: trace.test,v 1.16 2001/12/07 13:55:59 msofer Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -56,6 +56,18 @@ proc traceCommand {oldName newName op} { global info set info [list $oldName $newName $op] } + +test trace-0.0 {memory corruption in trace (Tcl Bug 484339)} { + # You may need Purify or Electric Fence to reliably + # see this one fail. + catch {unset z} + trace add variable z array {set z(foo) 1 ;#} + set res "names: [array names z]" + catch {unset ::z} + trace variable ::z w {unset ::z; error "memory corruption";#} + list [catch {set ::z 1} msg] $msg +} {1 {can't set "::z": memory corruption}} + # Read-tracing on variables test trace-1.1 {trace variable reads} { @@ -913,7 +925,7 @@ test trace-15.3 {special list-handling in trace commands} { trace add variable "x y z(a\n\{)" write traceProc set "x y z(a\n\{)" 33 set info -} "{x y z} a\\n\\{ write" +} "{x y z} a\\n\\\{ write" # Check for proper handling of unsets during traces. |