summaryrefslogtreecommitdiffstats
path: root/generic/tclOO.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2012-04-21 09:05:26 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2012-04-21 09:05:26 (GMT)
commitbf9624b12a9e6fe010e025b8f76d3e29c8399725 (patch)
tree4a50012f337604266eaaa8f85165ba22336f4fef /generic/tclOO.c
parent47e821e8297b9b9d7bb295a11f35c0307f2c1a7a (diff)
parentbcd88b005a09280f4b9725d611fd3763fd07241f (diff)
downloadtcl-bf9624b12a9e6fe010e025b8f76d3e29c8399725.zip
tcl-bf9624b12a9e6fe010e025b8f76d3e29c8399725.tar.gz
tcl-bf9624b12a9e6fe010e025b8f76d3e29c8399725.tar.bz2
merge trunk
Diffstat (limited to 'generic/tclOO.c')
-rw-r--r--generic/tclOO.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/generic/tclOO.c b/generic/tclOO.c
index 9dd8162..d5cc6e1 100644
--- a/generic/tclOO.c
+++ b/generic/tclOO.c
@@ -1624,6 +1624,15 @@ Tcl_NewObjectInstance(
state = Tcl_SaveInterpState(interp, TCL_OK);
contextPtr->callPtr->flags |= CONSTRUCTOR;
contextPtr->skip = skip;
+
+ /*
+ * 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;
+ }
result = Tcl_NRCallObjProc(interp, TclOOInvokeContext, contextPtr,
objc, objv);
@@ -1742,6 +1751,15 @@ TclNRNewObjectInstance(
contextPtr->skip = skip;
/*
+ * 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;
+ }
+
+ /*
* Fire off the constructors non-recursively.
*/
@@ -1762,7 +1780,6 @@ FinalizeAlloc(
Object *oPtr = data[1];
Tcl_InterpState state = data[2];
Tcl_Object *objectPtr = data[3];
- //int flags = oPtr->flags;
/*
* It's an error if the object was whacked in the constructor. Force this
@@ -2050,6 +2067,7 @@ Tcl_CopyObjectInstance(
}
}
+ TclResetRewriteEnsemble(interp, 1);
contextPtr = TclOOGetCallContext(o2Ptr, oPtr->fPtr->clonedName, 0, NULL);
if (contextPtr) {
args[0] = TclOOObjectName(interp, o2Ptr);
@@ -2064,6 +2082,10 @@ Tcl_CopyObjectInstance(
TclDecrRefCount(args[1]);
TclDecrRefCount(args[2]);
TclOODeleteContext(contextPtr);
+ if (result == TCL_ERROR) {
+ Tcl_AddErrorInfo(interp,
+ "\n (while performing post-copy callback)");
+ }
if (result != TCL_OK) {
Tcl_DeleteCommandFromToken(interp, o2Ptr->command);
return NULL;