summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandreas_kupries <akupries@shaw.ca>2008-04-17 19:14:17 (GMT)
committerandreas_kupries <akupries@shaw.ca>2008-04-17 19:14:17 (GMT)
commit09608e5bce1452abb2255e1f859f076afea463b9 (patch)
treea12e5be99c025aa9ba9b569eac8b524673bf46e5
parent29538c18237e7c58eb01d59da1c2d884ce682324 (diff)
downloadtcl-09608e5bce1452abb2255e1f859f076afea463b9.zip
tcl-09608e5bce1452abb2255e1f859f076afea463b9.tar.gz
tcl-09608e5bce1452abb2255e1f859f076afea463b9.tar.bz2
* generic/tclCompExpr.c (CompileMathFuncCall): Added
* tests/compile.test (compile-16.0): Tcl_ResetResult before appending error message, to clear out possible sharing. Added test case demonstrating the crash (abort on shared object) without the fix.
-rw-r--r--ChangeLog8
-rw-r--r--generic/tclCompExpr.c3
-rw-r--r--tests/compile.test8
3 files changed, 17 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 87ee56e..a55f42e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-04-17 Andreas Kupries <andreask@activestate.com>
+
+ * generic/tclCompExpr.c (CompileMathFuncCall): Added
+ * tests/compile.test (compile-16.0): Tcl_ResetResult before
+ appending error message, to clear out possible sharing. Added test
+ case demonstrating the crash (abort on shared object) without the
+ fix.
+
2008-04-15 Andreas Kupries <andreask@activestate.com>
*** 8.4.19 TAGGED FOR RELEASE ***
diff --git a/generic/tclCompExpr.c b/generic/tclCompExpr.c
index 3ff749b..8c66f5c 100644
--- a/generic/tclCompExpr.c
+++ b/generic/tclCompExpr.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCompExpr.c,v 1.13.2.3 2006/11/28 22:20:00 andreas_kupries Exp $
+ * RCS: @(#) $Id: tclCompExpr.c,v 1.13.2.4 2008/04/17 19:14:20 andreas_kupries Exp $
*/
#include "tclInt.h"
@@ -852,6 +852,7 @@ CompileMathFuncCall(exprTokenPtr, funcName, infoPtr, envPtr, endPtrPtr)
code = TCL_OK;
hPtr = Tcl_FindHashEntry(&iPtr->mathFuncTable, funcName);
if (hPtr == NULL) {
+ Tcl_ResetResult(interp);
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
"unknown math function \"", funcName, "\"", (char *) NULL);
code = TCL_ERROR;
diff --git a/tests/compile.test b/tests/compile.test
index 69d3d77..f31e2b9 100644
--- a/tests/compile.test
+++ b/tests/compile.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: compile.test,v 1.24.2.3 2004/10/26 20:14:36 dgp Exp $
+# RCS: @(#) $Id: compile.test,v 1.24.2.4 2008/04/17 19:14:20 andreas_kupries Exp $
package require tcltest 2
namespace import -force ::tcltest::*
@@ -432,6 +432,12 @@ test compile-15.5 {proper TCL_RETURN code from [return]} {
set result
} ""
+test compile-16.0 {error return from unbraced math func call of unknown function} {
+ set l {3 4 5}
+ catch { expr bogus([join $l ,]) } msg
+ set msg
+} {unknown math function "bogus"}
+
# cleanup
catch {rename p ""}