Index: generic/xotcl.c =================================================================== diff -u -r9e433e282c3daaa942647bd91851849692cd3052 -r2068ba7298e4ce370b36bdbda513172177f3ee52 --- generic/xotcl.c (.../xotcl.c) (revision 9e433e282c3daaa942647bd91851849692cd3052) +++ generic/xotcl.c (.../xotcl.c) (revision 2068ba7298e4ce370b36bdbda513172177f3ee52) @@ -4315,17 +4315,21 @@ XOTclClass *cl = NULL; CmdListRemoveEpoched(filters, GuardDel); - for (cmdList = *filters; cmdList; cmdList = cmdList->next) { + for (cmdList = *filters; cmdList; ) { simpleName = (char *) Tcl_GetCommandName(interp, cmdList->cmdPtr); cmd = FilterSearch(interp, simpleName, startingObj, startingCl, &cl); if (cmd == NULL) { - del = cmdList; - del = CmdListRemoveFromList(filters, del); + del = CmdListRemoveFromList(filters, cmdList); + cmdList = cmdList->next; CmdListDeleteCmdListEntry(del, GuardDel); } else if (cmd != cmdList->cmdPtr) { CmdListReplaceCmd(cmdList, cmd, cl); + cmdList = cmdList->next; + } else { + cmdList = cmdList->next; } } + /* some entries might be NULL now, if they are not found anymore -> delete those CmdListRemoveNulledEntries(filters, GuardDel); @@ -4969,7 +4973,7 @@ if (TclIsVarScalar(val)) { Tcl_Obj *oldValue = XOTclOGetInstVar2((XOTcl_Object*) obj, interp, varNameObj, NULL, - TCL_LEAVE_ERR_MSG|TCL_PARSE_PART1); + TCL_PARSE_PART1); /** we check whether the variable is already set. if so, we do not set it again */ if (oldValue == NULL) { @@ -5335,7 +5339,9 @@ fprintf(stderr, "method=%s\n", methodName); } */ - if (obj->opt && !rst->callIsDestroy) { + /* The order of the check is important, since obj might be already + freed in case the call was a instdestroy */ + if (!rst->callIsDestroy && obj->opt) { co = obj->opt->checkoptions; if ((co & CHECK_INVAR) && ((result = AssertionCheckInvars(interp, obj, methodName, co)) == TCL_ERROR)) { @@ -5700,8 +5706,11 @@ #ifdef DISPATCH_TRACE printExit(interp,"DISPATCH", objc, objv, result); - fprintf(stderr,"obj %p mixinStackPushed %d mixinStack %p\n", - obj, mixinStackPushed, obj->mixinStack); + fprintf(stderr,"obj=%p isDestroy %d\n",obj, rst->callIsDestroy); + if (!rst->callIsDestroy) { + fprintf(stderr,"obj %p mixinStackPushed %d mixinStack %p\n", + obj, mixinStackPushed, obj->mixinStack); + } #endif Index: generic/xotcl.h =================================================================== diff -u -ra958a0d660a332bb25cf4e3dfab757d65e3ca9af -r2068ba7298e4ce370b36bdbda513172177f3ee52 --- generic/xotcl.h (.../xotcl.h) (revision a958a0d660a332bb25cf4e3dfab757d65e3ca9af) +++ generic/xotcl.h (.../xotcl.h) (revision 2068ba7298e4ce370b36bdbda513172177f3ee52) @@ -50,6 +50,15 @@ #define XOTCL_BYTECODE */ +/* activate/deacticate profiling information at the end + of running the program +#define PROFILE +*/ + +/* make self, proc and class in instproc and procs +#define AUTOVARS +*/ + #define KEEP_TCL_CMD_TYPE 1 /* activate/deacticate assert @@ -61,23 +70,14 @@ #define XOTCL_MEM_TRACE 1 #define XOTCL_MEM_COUNT 1 */ + /*#define REFCOUNTED 1*/ /* #define XOTCLOBJ_TRACE 1 #define REFCOUNT_TRACE 1 -#define DISPATCH_TRACE 1 */ -/* activate/deacticate profiling information at the end - of running the program -#define PROFILE -*/ - -/* make self, proc and class in instproc and procs -#define AUTOVARS -*/ - /* turn tracing output on/off #define CALLSTACK_TRACE 1 #define DISPATCH_TRACE 1 Index: tests/testx.xotcl =================================================================== diff -u -r802641dc2edee9e8ac569ad9c9cbadc949df8d47 -r2068ba7298e4ce370b36bdbda513172177f3ee52 --- tests/testx.xotcl (.../testx.xotcl) (revision 802641dc2edee9e8ac569ad9c9cbadc949df8d47) +++ tests/testx.xotcl (.../testx.xotcl) (revision 2068ba7298e4ce370b36bdbda513172177f3ee52) @@ -1171,10 +1171,9 @@ my instvar a b cc return $r--${a}--[set cc] } - set safedObjFilters [Object info filter] Object instfilter "" - C1 c1 + C1 c1 Object instfilter $safedObjFilters if {$i == 0} { @@ -1189,7 +1188,7 @@ set FInfo "" set result [c1 m1] - + ::errorCheck $FInfo \ "{callingclass {} filterreg {::C0 instfilter infoFilter} callingobject ::filterInfo callingproc run calledproc m1} {callingclass ::C0 filterreg {::C0 instfilter infoFilter} callingobject ::c1 callingproc m1 calledproc instvar} {self ::c1 proc infoFilter class ::C0 infoclass ::C1 r {}} {callingclass ::C1 filterreg {::C0 instfilter infoFilter} callingobject ::c1 callingproc m1 calledproc instvar} {self ::c1 proc infoFilter class ::C0 infoclass ::C1 r {}} {self ::c1 proc infoFilter class ::C0 infoclass ::C1 r 1--1--1}" \ "Wrong filtering of c1 m1" @@ -1199,8 +1198,8 @@ ::errorCheck $result \ "1--1--1" "Wrong return result of Filter Example 2 'c1 m1' " - - Class T0 + + Class T0 FI addFilter T0 T0 instproc m {} { set e -0=showStack-1=showCall-2=m-3=m-4=m-5=run-6=run @@ -1226,7 +1225,6 @@ set r2 [next] set r after-[self]-[self proc]-[self class]-[my info class]-${r1}-$r2 } - T1 t set FInfo ""