summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2017-11-08 02:21:49 (GMT)
committerdgp <dgp@users.sourceforge.net>2017-11-08 02:21:49 (GMT)
commit98c6b22c1002fae94f8abf7422758530a9a6fdeb (patch)
tree1dc914c23bf68fc2a7835808401d6a463674c0c6 /generic
parentac4fb39a73fb01e2cbb763a086191aa4fcec175f (diff)
downloadtcl-98c6b22c1002fae94f8abf7422758530a9a6fdeb.zip
tcl-98c6b22c1002fae94f8abf7422758530a9a6fdeb.tar.gz
tcl-98c6b22c1002fae94f8abf7422758530a9a6fdeb.tar.bz2
TclOO object allocation: Set classPtr to NULL if it wasn't otherwise set.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclOO.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/generic/tclOO.c b/generic/tclOO.c
index ec666ee..f236ac9 100644
--- a/generic/tclOO.c
+++ b/generic/tclOO.c
@@ -537,7 +537,8 @@ KillFoundation(
* AllocObject --
*
* Allocate an object of basic type. Does not splice the object into its
- * class's instance list.
+ * class's instance list. The caller must set the classPtr on the object,
+ * either to a class or to NULL.
*
* ----------------------------------------------------------------------
*/
@@ -1672,6 +1673,8 @@ Tcl_NewObjectInstance(
AllocClass(interp, oPtr);
oPtr->selfCls = classPtr;
TclOOAddToSubclasses(oPtr->classPtr, fPtr->objectCls);
+ } else {
+ oPtr->classPtr = NULL;
}
/*