Index: ChangeLog =================================================================== diff -u -rcedbcd6a70c433f37525ad01e254895b600db08b -r018ced50b0b8139c67310d99f9541e933b7a1f2d --- ChangeLog (.../ChangeLog) (revision cedbcd6a70c433f37525ad01e254895b600db08b) +++ ChangeLog (.../ChangeLog) (revision 018ced50b0b8139c67310d99f9541e933b7a1f2d) @@ -1,5 +1,10 @@ +2008-01-02: + - fixed evaluation context in guard expressions + ([self callingproc] returned "" in cases, where the callingproc + was possible to determine) + 2007-12-28: - - fixed crash for deleted classes in new code + - fixed crash for deleted classes in new code (mixinof) - changed name from MixinResetInstanceOrder() to MixinResetOrderForInstances() - improving documentation - made code more local Index: generic/xotcl.c =================================================================== diff -u -rcedbcd6a70c433f37525ad01e254895b600db08b -r018ced50b0b8139c67310d99f9541e933b7a1f2d --- generic/xotcl.c (.../xotcl.c) (revision cedbcd6a70c433f37525ad01e254895b600db08b) +++ generic/xotcl.c (.../xotcl.c) (revision 018ced50b0b8139c67310d99f9541e933b7a1f2d) @@ -2222,18 +2222,21 @@ XOTclCallStackFindLastInvocation(Tcl_Interp *interp, int offset) { XOTclCallStack *cs = &RUNTIME_STATE(interp)->cs; register XOTclCallStackContent *csc = cs->top; - int topLevel = csc->currentFramePtr ? Tcl_CallFrame_level(csc->currentFramePtr) :0; + int topLevel = csc->currentFramePtr ? Tcl_CallFrame_level(csc->currentFramePtr) : 0; int deeper = offset; /* skip through toplevel inactive filters, do this offset times */ for (csc=cs->top; csc > cs->content; csc--) { + /* fprintf(stderr, "csc %p callType = %x, frameType = %x, offset=%d\n", + csc,csc->callType,csc->frameType,offset); */ if ((csc->callType & XOTCL_CSC_CALL_IS_NEXT) || (csc->frameType & XOTCL_CSC_TYPE_INACTIVE)) continue; if (offset) offset--; else { - if (!deeper) { + /* fprintf(stderr, "csc %p offset ok, deeper=%d\n",csc,deeper); */ + if (!deeper || cs->top->callType & XOTCL_CSC_CALL_IS_GUARD) { return csc; } if (csc->currentFramePtr && Tcl_CallFrame_level(csc->currentFramePtr) < topLevel) { @@ -2242,6 +2245,7 @@ } } /* for some reasons, we could not find invocation (topLevel, destroy) */ + /* fprintf(stderr, "csc %p could not find invocation\n",csc);*/ return NULL; } @@ -3809,9 +3813,12 @@ int rc = TCL_OK; if (clientData) { + XOTclCallStackContent *csc = CallStackGetTopFrame(interp); Tcl_Obj *res = Tcl_GetObjResult(interp); /* save the result */ INCR_REF_COUNT(res); + csc->callType |= XOTCL_CSC_CALL_IS_GUARD; + /* GuardPrint(interp, cmdList->clientData); */ /* * ok, there is a guard ... we have to push a Index: generic/xotclInt.h =================================================================== diff -u -rcedbcd6a70c433f37525ad01e254895b600db08b -r018ced50b0b8139c67310d99f9541e933b7a1f2d --- generic/xotclInt.h (.../xotclInt.h) (revision cedbcd6a70c433f37525ad01e254895b600db08b) +++ generic/xotclInt.h (.../xotclInt.h) (revision 018ced50b0b8139c67310d99f9541e933b7a1f2d) @@ -603,6 +603,7 @@ #define XOTCL_CSC_CALL_IS_NEXT 1 #define XOTCL_CSC_CALL_IS_DESTROY 2 +#define XOTCL_CSC_CALL_IS_GUARD 4 typedef struct XOTclCallStack { XOTclCallStackContent content[MAX_NESTING_DEPTH];