summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--generic/tclBasic.c13
2 files changed, 9 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index bab001c..9986761 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2008-03-14 Don Porter <dgp@users.sourceforge.net>
+ * generic/tclBasic.c (OldMathFuncProc): Same workaround protection
+ from bad TclStackAlloc() alignment. Thanks George Peter Staplin.
+
* generic/tclCmdIL.c (Tcl_LsortObjCmd): Use ckalloc() to allocate
SortElement arrays instead of TclStackAlloc() which isn't getting
alignment right. Workaround for [Bug 1914503].
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index b7f3423..07c2ef7 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -14,7 +14,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclBasic.c,v 1.294 2008/03/10 16:18:54 dgp Exp $
+ * RCS: @(#) $Id: tclBasic.c,v 1.295 2008/03/14 19:53:10 dgp Exp $
*/
#include "tclInt.h"
@@ -3108,8 +3108,7 @@ OldMathFuncProc(
* Convert arguments from Tcl_Obj's to Tcl_Value's.
*/
- args = (Tcl_Value *)
- TclStackAlloc(interp, dataPtr->numArgs * sizeof(Tcl_Value));
+ args = (Tcl_Value *) ckalloc(dataPtr->numArgs * sizeof(Tcl_Value));
for (j = 1, k = 0; j < objc; ++j, ++k) {
/* TODO: Convert to TclGetNumberFromObj() ? */
@@ -3129,7 +3128,7 @@ OldMathFuncProc(
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"argument to math function didn't have numeric value",-1));
TclCheckBadOctal(interp, Tcl_GetString(valuePtr));
- TclStackFree(interp, args);
+ ckfree((char *)args);
return TCL_ERROR;
}
@@ -3161,7 +3160,7 @@ OldMathFuncProc(
break;
case TCL_INT:
if (ExprIntFunc(NULL, interp, 2, &(objv[j-1])) != TCL_OK) {
- TclStackFree(interp, args);
+ ckfree((char *)args);
return TCL_ERROR;
}
valuePtr = Tcl_GetObjResult(interp);
@@ -3170,7 +3169,7 @@ OldMathFuncProc(
break;
case TCL_WIDE_INT:
if (ExprWideFunc(NULL, interp, 2, &(objv[j-1])) != TCL_OK) {
- TclStackFree(interp, args);
+ ckfree((char *)args);
return TCL_ERROR;
}
valuePtr = Tcl_GetObjResult(interp);
@@ -3186,7 +3185,7 @@ OldMathFuncProc(
errno = 0;
result = (*dataPtr->proc)(dataPtr->clientData, interp, args, &funcResult);
- TclStackFree(interp, args);
+ ckfree((char *)args);
if (result != TCL_OK) {
return result;
}