summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpooryorick <com.digitalsmarties@pooryorick.com>2018-02-15 09:34:49 (GMT)
committerpooryorick <com.digitalsmarties@pooryorick.com>2018-02-15 09:34:49 (GMT)
commite16817b40903d522f5a911fde6e1640321e94e26 (patch)
tree5af11edf173ed20b90a23ae301b0acb9f8448311
parent03a4436237ea997e7a2992ca80c54848cefdb213 (diff)
downloadtcl-e16817b40903d522f5a911fde6e1640321e94e26.zip
tcl-e16817b40903d522f5a911fde6e1640321e94e26.tar.gz
tcl-e16817b40903d522f5a911fde6e1640321e94e26.tar.bz2
Add the check for wrong arguments back to TclOO_Object_Destroy, remove
inadvertant increment of Namespace->refCount.
-rw-r--r--generic/tclBasic.c1
-rw-r--r--generic/tclOO.c4
-rw-r--r--generic/tclOOBasic.c5
3 files changed, 8 insertions, 2 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index 7b9db33..3fb099b 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -3137,7 +3137,6 @@ Tcl_DeleteCommandFromToken(
cmdPtr->nsPtr->refCount++;
- cmdPtr->nsPtr->refCount++;
if (cmdPtr->tracePtr != NULL) {
CommandTrace *tracePtr;
CallCommandTraces(iPtr,cmdPtr,NULL,NULL,TCL_TRACE_DELETE);
diff --git a/generic/tclOO.c b/generic/tclOO.c
index 4fab5d5..4915b5d 100644
--- a/generic/tclOO.c
+++ b/generic/tclOO.c
@@ -235,8 +235,10 @@ MODULE_SCOPE const TclOOStubs tclOOStubs;
#define IsRoot(ocPtr) ((ocPtr)->flags & (ROOT_OBJECT|ROOT_CLASS))
#define RemoveItem(type, lst, i) \
+ do { \
Remove ## type ((lst).list, (lst).num, i); \
- (lst).num--
+ (lst).num-- \
+ } while 0
/*
* ----------------------------------------------------------------------
diff --git a/generic/tclOOBasic.c b/generic/tclOOBasic.c
index 84f414d..b2c06a7 100644
--- a/generic/tclOOBasic.c
+++ b/generic/tclOOBasic.c
@@ -340,6 +340,11 @@ TclOO_Object_Destroy(
Object *oPtr = (Object *) Tcl_ObjectContextObject(context);
CallContext *contextPtr;
+ if (objc != Tcl_ObjectContextSkippedArgs(context)) {
+ Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv,
+ NULL);
+ return TCL_ERROR;
+ }
if (!(oPtr->flags & DESTRUCTOR_CALLED)) {
oPtr->flags |= DESTRUCTOR_CALLED;
contextPtr = TclOOGetCallContext(oPtr, NULL, DESTRUCTOR, NULL);