summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2016-05-26 17:27:56 (GMT)
committerdgp <dgp@users.sourceforge.net>2016-05-26 17:27:56 (GMT)
commit63e94b434f939d7609e8c033d38bf40b75d02041 (patch)
treebcc590086d6e13d86b8ccac5f7e9334f5d9b676e /generic
parent41a668a5156c041fb8e744d1785026b5611c0301 (diff)
downloadtcl-63e94b434f939d7609e8c033d38bf40b75d02041.zip
tcl-63e94b434f939d7609e8c033d38bf40b75d02041.tar.gz
tcl-63e94b434f939d7609e8c033d38bf40b75d02041.tar.bz2
constructor invocation ensemble rewrite shenanigans also fit into the
refactored routines.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclOO.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/generic/tclOO.c b/generic/tclOO.c
index 9df5029..0454bfe 100644
--- a/generic/tclOO.c
+++ b/generic/tclOO.c
@@ -1687,7 +1687,7 @@ Tcl_NewObjectInstance(
TclOOGetCallContext(oPtr, NULL, CONSTRUCTOR, NULL);
if (contextPtr != NULL) {
- int result;
+ int isRoot, result;
Tcl_InterpState state;
state = Tcl_SaveInterpState(interp, TCL_OK);
@@ -1698,13 +1698,14 @@ Tcl_NewObjectInstance(
* Adjust the ensmble tracking record if necessary. [Bug 3514761]
*/
- if (((Interp*) interp)->ensembleRewrite.sourceObjs) {
- ((Interp*) interp)->ensembleRewrite.numInsertedObjs += skip-1;
- ((Interp*) interp)->ensembleRewrite.numRemovedObjs += skip-1;
- }
+ isRoot = TclInitRewriteEnsemble(interp, skip, skip, objv);
result = Tcl_NRCallObjProc(interp, TclOOInvokeContext, contextPtr,
objc, objv);
+ if (isRoot) {
+ TclResetRewriteEnsemble(interp, 1);
+ }
+
/*
* It's an error if the object was whacked in the constructor.
* Force this if it isn't already an error (don't want to lose
@@ -1827,9 +1828,8 @@ TclNRNewObjectInstance(
* Adjust the ensmble tracking record if necessary. [Bug 3514761]
*/
- if (((Interp *) interp)->ensembleRewrite.sourceObjs) {
- ((Interp *) interp)->ensembleRewrite.numInsertedObjs += skip - 1;
- ((Interp *) interp)->ensembleRewrite.numRemovedObjs += skip - 1;
+ if (TclInitRewriteEnsemble(interp, skip, skip, objv)) {
+ TclNRAddCallback(interp, TclClearRootEnsemble, NULL, NULL, NULL, NULL);
}
/*