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)
commite922cb1cd3d13490b9f58bc1ff9a09dae1c5f77c (patch)
tree0eeb703224f6ae757ab409e4196bc4b0ceb50199 /generic/tclOOInfo.c
parenta166c55da0595a28b635191dbb6307cbb85428d4 (diff)
downloadtcl-e922cb1cd3d13490b9f58bc1ff9a09dae1c5f77c.zip
tcl-e922cb1cd3d13490b9f58bc1ff9a09dae1c5f77c.tar.gz
tcl-e922cb1cd3d13490b9f58bc1ff9a09dae1c5f77c.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));
}