summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2007-12-05 18:09:50 (GMT)
committerdgp <dgp@users.sourceforge.net>2007-12-05 18:09:50 (GMT)
commitf871c9d6cd3f4e13bb58cd768fba190b3ce00e0e (patch)
tree8c3520f38e393b34149600a3fb4348cefecffa6f
parent003d1220e705f2bac33e44e0c1752bd43e1efd6d (diff)
downloadtcl-f871c9d6cd3f4e13bb58cd768fba190b3ce00e0e.zip
tcl-f871c9d6cd3f4e13bb58cd768fba190b3ce00e0e.tar.gz
tcl-f871c9d6cd3f4e13bb58cd768fba190b3ce00e0e.tar.bz2
merge updates from HEAD
-rw-r--r--ChangeLog5
-rw-r--r--generic/tclCmdIL.c16
-rw-r--r--tests/lsearch.test11
3 files changed, 30 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index dccae1e..8bde93f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-12-05 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ * generic/tclCmdIL.c (Tcl_LsearchObjCmd): Prevent shimmering crash
+ when -exact and -integer/-real are mixed. [Bug 1844789]
+
2007-12-03 Donal K. Fellows <dkf@users.sf.net>
* unix/tclUnixChan.c (CreateSocketAddress): Add extra #ifdef-fery to
diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c
index b750d53..4f63892 100644
--- a/generic/tclCmdIL.c
+++ b/generic/tclCmdIL.c
@@ -16,7 +16,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCmdIL.c,v 1.115.2.11 2007/11/21 16:26:59 dgp Exp $
+ * RCS: @(#) $Id: tclCmdIL.c,v 1.115.2.12 2007/12/05 18:09:52 dgp Exp $
*/
#include "tclInt.h"
@@ -2993,6 +2993,13 @@ Tcl_LsearchObjCmd(
}
return result;
}
+
+ /*
+ * List representation might have been shimmered; restore it. [Bug
+ * 1844789]
+ */
+
+ TclListObjGetElements(NULL, objv[objc - 2], &listc, &listv);
break;
case REAL:
result = Tcl_GetDoubleFromObj(interp, patObj, &patDouble);
@@ -3002,6 +3009,13 @@ Tcl_LsearchObjCmd(
}
return result;
}
+
+ /*
+ * List representation might have been shimmered; restore it. [Bug
+ * 1844789]
+ */
+
+ TclListObjGetElements(NULL, objv[objc - 2], &listc, &listv);
break;
}
} else {
diff --git a/tests/lsearch.test b/tests/lsearch.test
index fcaa85b..fb540b4 100644
--- a/tests/lsearch.test
+++ b/tests/lsearch.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: lsearch.test,v 1.18 2005/12/09 14:13:01 dkf Exp $
+# RCS: @(#) $Id: lsearch.test,v 1.18.8.1 2007/12/05 18:09:55 dgp Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -463,6 +463,15 @@ test lsearch-20.3 {lsearch -index option, malformed index} {
list [catch {lsearch -index \{ {{a c} {a b} {a a}} a} msg] $msg
} {1 {unmatched open brace in list}}
+test lsearch-21.1 {lsearch shimmering crash} {
+ set x 0
+ lsearch -exact -integer $x $x
+} 0
+test lsearch-21.2 {lsearch shimmering crash} {
+ set x 0.5
+ lsearch -exact -real $x $x
+} 0
+
# cleanup
catch {unset res}
catch {unset increasingIntegers}