summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authormsofer <msofer@noemail.net>2001-12-07 13:55:58 (GMT)
committermsofer <msofer@noemail.net>2001-12-07 13:55:58 (GMT)
commit2a04bc5fdf738c2b608b3b423ca5b5f3911ca74d (patch)
treebe9d02ee7c40c6fd4919fc83c406315d3807c43d /tests
parent0234a989743aa7d0ccaa772437be0b4e72e00192 (diff)
downloadtcl-2a04bc5fdf738c2b608b3b423ca5b5f3911ca74d.zip
tcl-2a04bc5fdf738c2b608b3b423ca5b5f3911ca74d.tar.gz
tcl-2a04bc5fdf738c2b608b3b423ca5b5f3911ca74d.tar.bz2
restored consistency in refCount accounting by array traces [Bug #4484339]
FossilOrigin-Name: 23f9cbbc0021bbbab98aa4a6d1cdad7ed3c106d5
Diffstat (limited to 'tests')
-rw-r--r--tests/trace.test16
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.