summaryrefslogtreecommitdiffstats
path: root/generic/tclOOInfo.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2015-11-21 22:22:49 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2015-11-21 22:22:49 (GMT)
commit6b4bc6bb8d46722088d73bd4a93f51e7fc65dbf4 (patch)
tree0eeb703224f6ae757ab409e4196bc4b0ceb50199 /generic/tclOOInfo.c
parent67929efb233a934a2d625216ee8d3b1d8022d33e (diff)
downloadtcl-6b4bc6bb8d46722088d73bd4a93f51e7fc65dbf4.zip
tcl-6b4bc6bb8d46722088d73bd4a93f51e7fc65dbf4.tar.gz
tcl-6b4bc6bb8d46722088d73bd4a93f51e7fc65dbf4.tar.bz2
[3d96b7076e] Prevent crashes when destroying an object's class inside a method call.
Diffstat (limited to 'generic/tclOOInfo.c')
-rw-r--r--generic/tclOOInfo.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/generic/tclOOInfo.c b/generic/tclOOInfo.c
index 0c22bcf..76eaef5 100644
--- a/generic/tclOOInfo.c
+++ b/generic/tclOOInfo.c
@@ -196,6 +196,9 @@ InfoObjectClassCmd(
}
FOREACH(mixinPtr, oPtr->mixins) {
+ if (!mixinPtr) {
+ continue;
+ }
if (TclOOIsReachable(o2clsPtr, mixinPtr)) {
Tcl_SetObjResult(interp, Tcl_NewIntObj(1));
return TCL_OK;
@@ -467,6 +470,9 @@ InfoObjectIsACmd(
Class *mixinPtr;
FOREACH(mixinPtr, oPtr->mixins) {
+ if (!mixinPtr) {
+ continue;
+ }
if (TclOOIsReachable(o2Ptr->classPtr, mixinPtr)) {
result = 1;
break;
@@ -665,6 +671,9 @@ InfoObjectMixinsCmd(
resultObj = Tcl_NewObj();
FOREACH(mixinPtr, oPtr->mixins) {
+ if (!mixinPtr) {
+ continue;
+ }
Tcl_ListObjAppendElement(NULL, resultObj,
TclOOObjectName(interp, mixinPtr->thisPtr));
}
@@ -1281,6 +1290,9 @@ InfoClassMixinsCmd(
resultObj = Tcl_NewObj();
FOREACH(mixinPtr, clsPtr->mixins) {
+ if (!mixinPtr) {
+ continue;
+ }
Tcl_ListObjAppendElement(NULL, resultObj,
TclOOObjectName(interp, mixinPtr->thisPtr));
}