summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-09-11 14:11:49 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-09-11 14:11:49 (GMT)
commitd16f803f15be4e185b584faf662863362cfffe5c (patch)
tree750993d2434b7f0f8e0afa380373c8eea9e86be6 /generic
parentaa4c91c8385dab2f9ad53cdf6b7f6d855553679a (diff)
parent779b664e54a9f926fbbd56866693099fe4ee2639 (diff)
downloadtcl-d16f803f15be4e185b584faf662863362cfffe5c.zip
tcl-d16f803f15be4e185b584faf662863362cfffe5c.tar.gz
tcl-d16f803f15be4e185b584faf662863362cfffe5c.tar.bz2
Merge 8.7
Diffstat (limited to 'generic')
-rw-r--r--generic/tclExecute.c6
-rw-r--r--generic/tclInt.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index b04a5c5..875601e 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -797,8 +797,8 @@ TclCreateExecEnv(
* [sizeof(Tcl_Obj*)] */
{
ExecEnv *eePtr = (ExecEnv *)Tcl_Alloc(sizeof(ExecEnv));
- ExecStack *esPtr = (ExecStack *)Tcl_Alloc(sizeof(ExecStack)
- + (size-1) * sizeof(Tcl_Obj *));
+ ExecStack *esPtr = (ExecStack *)Tcl_Alloc(offsetof(ExecStack, stackWords)
+ + size * sizeof(Tcl_Obj *));
eePtr->execStackPtr = esPtr;
TclNewIntObj(eePtr->constants[0], 0);
@@ -1063,7 +1063,7 @@ GrowEvaluationStack(
newElems = needed;
#endif
- newBytes = sizeof(ExecStack) + (newElems-1) * sizeof(Tcl_Obj *);
+ newBytes = offsetof(ExecStack, stackWords) + newElems * sizeof(Tcl_Obj *);
oldPtr = esPtr;
esPtr = (ExecStack *)Tcl_Alloc(newBytes);
diff --git a/generic/tclInt.h b/generic/tclInt.h
index fba5ecd..1919e9a 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -1445,7 +1445,7 @@ typedef struct ExecStack {
Tcl_Obj **markerPtr;
Tcl_Obj **endPtr;
Tcl_Obj **tosPtr;
- Tcl_Obj *stackWords[1];
+ Tcl_Obj *stackWords[TCLFLEXARRAY];
} ExecStack;
/*