summaryrefslogtreecommitdiffstats
path: root/tests/basic.test
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2005-02-10 19:08:09 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2005-02-10 19:08:09 (GMT)
commit845d57e6dffb951a34e335af39e3b372ac51b43f (patch)
tree16e762307c2913e4307a68bbf586c4be24c6538e /tests/basic.test
parent1a5a2eb1b627378e66065f252594ff677891fccc (diff)
downloadtcl-845d57e6dffb951a34e335af39e3b372ac51b43f.zip
tcl-845d57e6dffb951a34e335af39e3b372ac51b43f.tar.gz
tcl-845d57e6dffb951a34e335af39e3b372ac51b43f.tar.bz2
* generic/tclBasic.c (Tcl_EvalObjEx):
* tests/basic.test (basic-26.2): preserve the arguments passed to TEOV in the pure-list branch, in case the list shimmers away. Fix for [Bug 1119369], reported by Peter MacDonald.
Diffstat (limited to 'tests/basic.test')
-rw-r--r--tests/basic.test20
1 files changed, 19 insertions, 1 deletions
diff --git a/tests/basic.test b/tests/basic.test
index da5449b..7a4b58d 100644
--- a/tests/basic.test
+++ b/tests/basic.test
@@ -15,7 +15,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: basic.test,v 1.36 2004/11/18 19:22:12 dgp Exp $
+# RCS: @(#) $Id: basic.test,v 1.37 2005/02/10 19:08:12 msofer Exp $
#
package require tcltest 2
@@ -438,6 +438,24 @@ test basic-26.1 {Tcl_EvalObj: preserve object while evaling it} -setup {
rename myHandler {}
} -result "foo\n while executing\n\"error foo\""
+test basic-26.2 {Tcl_EvalObjEx, pure-list branch: preserve "objv"} {
+ #
+ # Follow the pure-list branch in a manner that
+ # a - the pure-list internal rep is destroyed by shimmering
+ # b - the command returns an error
+ # As the error code in Tcl_EvalObjv accesses the list elements, this will
+ # cause a segfault if [Bug 1119369] has not been fixed.
+ #
+
+ set SRC [list foo 1] ;# pure-list command
+ proc foo str {
+ # Shimmer pure-list to cmdName, cleanup and error
+ proc $::SRC {} {}; $::SRC
+ error "BAD CALL"
+ }
+ catch {eval $SRC}
+} 1
+
test basic-27.1 {Tcl_ExprLong} {emptyTest} {
} {}