From 1816d85fa717e1df558b790c5c324786c314258c Mon Sep 17 00:00:00 2001 From: hobbs Date: Fri, 21 Jan 2000 03:40:04 +0000 Subject: added test for [info body] bytecompiled object bug --- tests/info.test | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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" -- cgit v0.12