summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2008-03-14 19:53:08 (GMT)
committerdgp <dgp@users.sourceforge.net>2008-03-14 19:53:08 (GMT)
commitbd688c3b4dd5db4f0a7b0d911efa133f87527569 (patch)
tree9134b1534f6ec444879e3bcd5e7d6288e389ca67 /generic
parent13a258e3cb2d255dedbc5e2ef9b4815de4823ae0 (diff)
downloadtcl-bd688c3b4dd5db4f0a7b0d911efa133f87527569.zip
tcl-bd688c3b4dd5db4f0a7b0d911efa133f87527569.tar.gz
tcl-bd688c3b4dd5db4f0a7b0d911efa133f87527569.tar.bz2
* generic/tclBasic.c (OldMathFuncProc): Same workaround protection
from bad TclStackAlloc() alignment. Thanks George Peter Staplin.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclBasic.c13
1 files changed, 6 insertions, 7 deletions
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;
}