summaryrefslogtreecommitdiffstats
path: root/tests/info.test
diff options
context:
space:
mode:
authorhobbs <hobbs>2000-01-21 03:40:04 (GMT)
committerhobbs <hobbs>2000-01-21 03:40:04 (GMT)
commit1816d85fa717e1df558b790c5c324786c314258c (patch)
tree869760d15dcf8205bfede3c5cfcd6398638fe45b /tests/info.test
parentac4b7b9af8a470c5eace5289a1baa2272b88d8ac (diff)
downloadtcl-1816d85fa717e1df558b790c5c324786c314258c.zip
tcl-1816d85fa717e1df558b790c5c324786c314258c.tar.gz
tcl-1816d85fa717e1df558b790c5c324786c314258c.tar.bz2
added test for [info body] bytecompiled object bug
Diffstat (limited to 'tests/info.test')
-rw-r--r--tests/info.test17
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/info.test b/tests/info.test
index a9ba98b..f8fdd43 100644
--- a/tests/info.test
+++ b/tests/info.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: info.test,v 1.13 2000/01/12 11:13:25 hobbs Exp $
+# RCS: @(#) $Id: info.test,v 1.14 2000/01/21 03:40:04 hobbs Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -79,6 +79,21 @@ test info-2.4 {info body option} {
list [info body p] [info body q]
}
} {{return "x=$x"} {return "y=$y"}}
+test info-2.5 {info body option, returning bytecompiled bodies} {
+ # Prior to 8.3.0 this would cause a crash because [info body]
+ # would return the bytecompiled version of foo, which the catch
+ # would then try and eval out of the foo context, accessing
+ # compiled local indices
+ catch {unset args}
+ proc foo {args} {
+ foreach v $args {
+ upvar $v var
+ return "variable $v existence: [info exists var]"
+ }
+ }
+ foo a
+ list [catch [info body foo] msg] $msg
+} {1 {can't read "args": no such variable}}
# "info cmdcount" is no longer accurate for compiled commands!
# The expected result for info-3.1 used to be "3" and is now "1"