Index: TODO =================================================================== diff -u -r84b5a359f46650d7b05d254a09825cfc0ba0c3fb -r5371aaaf333c92616a8baf6e521df386909b876d --- TODO (.../TODO) (revision 84b5a359f46650d7b05d254a09825cfc0ba0c3fb) +++ TODO (.../TODO) (revision 5371aaaf333c92616a8baf6e521df386909b876d) @@ -3794,8 +3794,8 @@ - strip unneeded space - fixed potential crash when generating error message about argument usage when called without a callstack +- added regression test - ======================================================================== TODO: Index: generic/nsf.c =================================================================== diff -u -r63a1262db92115ac1026267b308ca14a190576ce -r5371aaaf333c92616a8baf6e521df386909b876d --- generic/nsf.c (.../nsf.c) (revision 63a1262db92115ac1026267b308ca14a190576ce) +++ generic/nsf.c (.../nsf.c) (revision 5371aaaf333c92616a8baf6e521df386909b876d) @@ -9600,7 +9600,8 @@ { Tcl_CallFrame *framePtr1; NsfCallStackContent *cscPtr1 = CallStackGetTopFrame(interp, &framePtr1); - + + assert(cscPtr1); if ((cscPtr1->frameType & NSF_CSC_TYPE_ENSEMBLE)) { /* * We are in an ensemble method. The next works here not on the @@ -9994,7 +9995,7 @@ NsfCallStackContent *cscPtr1 = CallStackGetTopFrame0(interp); if (unlikely(cscPtr1 == NULL)) { - return NsfPrintError(interp, "local flag only allowed when called from a method body"); + return NsfPrintError(interp, "Flag '-local' only allowed when called from a method body"); } if (cscPtr1->cl) { cmd = FindMethod(cscPtr1->cl->nsPtr, methodName); Index: tests/contains.test =================================================================== diff -u -r9a0b8bb0992be0561d8187c275fc1d9b7e0bbcd0 -r5371aaaf333c92616a8baf6e521df386909b876d --- tests/contains.test (.../contains.test) (revision 9a0b8bb0992be0561d8187c275fc1d9b7e0bbcd0) +++ tests/contains.test (.../contains.test) (revision 5371aaaf333c92616a8baf6e521df386909b876d) @@ -82,6 +82,14 @@ } ? {c2 bar} "::c2-::c2" +# +# Test potential crash, when methodNamePath is computed without a +# stack frame +# +C public method foo {{-new 0} name value} { return $value} +catch {c1 foo -name a b} errMsg +? {set errMsg} \ + {Invalid argument 'b', maybe too many arguments; should be "::c1 foo ?-new value? name value"} # Test resolving of implicit namespaces in relationcmds (here # superclass) in the nx namespace.