Index: TODO =================================================================== diff -u -rb4318730d5cb6a1dbb095283c27325acd4d3b9be -r472a3c5f359bb9b2d0aeadc7937ba2bc6aecdbc9 --- TODO (.../TODO) (revision b4318730d5cb6a1dbb095283c27325acd4d3b9be) +++ TODO (.../TODO) (revision 472a3c5f359bb9b2d0aeadc7937ba2bc6aecdbc9) @@ -5873,6 +5873,7 @@ - Added Rosetta example: https://rosettacode.org/wiki/Inheritance/Single - new subcommand "nsf::current level", returns empty, if we are not on a nsf frame/level. +- improve sanity test in ISOBJ(): obj->bytes might only be NULL when type is given. ======================================================================== TODO: @@ -5883,9 +5884,6 @@ - Under core-8-5-branch, make test --enable-development yields an assertion failure: - ./tests/parameters.test - Assertion failed: (ISOBJ(objv[pcPtr->lastObjc-1])), function ArgumentParse, file ./generic/nsf.c, line 22155. - - Should we add exists to the Variableslot-Interface, to surface ::nsf::var::exists. + ::nx::VariableSlot public method value=exists {obj prop} { Index: generic/nsf.c =================================================================== diff -u -r77ba24ec459d9168dbfad4ae0c6eb4b936e8ea6b -r472a3c5f359bb9b2d0aeadc7937ba2bc6aecdbc9 --- generic/nsf.c (.../nsf.c) (revision 77ba24ec459d9168dbfad4ae0c6eb4b936e8ea6b) +++ generic/nsf.c (.../nsf.c) (revision 472a3c5f359bb9b2d0aeadc7937ba2bc6aecdbc9) @@ -21890,7 +21890,14 @@ } fprintf(stderr, "\n"); fprintf(stderr, "BEGIN (%d) [0]%s ", objc, ObjStr(procNameObj)); - for (o = fromArg; o < objc; o++) {fprintf(stderr, "[%d]%s ", o, ObjStr(objv[o]));} + for (o = fromArg; o < objc; o++) { + Tcl_Obj *obj = objv[o]; + if (obj->bytes == NULL) { + fprintf(stderr, "[%d]unk(%s) ", o, obj->typePtr->name); + } else { + fprintf(stderr, "[%d]%s ", o, ObjStr(obj)); + } + } fprintf(stderr, "\n"); } #endif @@ -22175,7 +22182,7 @@ #if defined(PARSE_TRACE_FULL) - fprintf(stderr, "... args found o %d objc %d is dashdash %d [%d] <%s>\n", o, objc, dashdash, j, ObjStr(argumentObj)); + fprintf(stderr, "... args found o %d objc %d is dashdash %d [%ld] <%s>\n", o, objc, dashdash, j, ObjStr(argumentObj)); #endif break; @@ -22210,7 +22217,7 @@ } #if defined(PARSE_TRACE_FULL) - fprintf(stderr, "... setting parameter %s pos %d valueObj '%s'\n", + fprintf(stderr, "... setting parameter %s pos %ld valueObj '%s'\n", pPtr->name, j, valueObj == argumentObj ? "=" : ObjStr(valueObj)); #endif @@ -24979,7 +24986,7 @@ /* * No need to parse arguments (local, intrinsic, ...). */ - return ObjectDispatch(self, interp, nobjc, nobjv, 0); + return ObjectDispatch(self, interp, nobjc, nobjv, 0u); } else { ParseContext pc; int withIntrinsic, withLocal, withSystem; Index: generic/nsfInt.h =================================================================== diff -u -r77ba24ec459d9168dbfad4ae0c6eb4b936e8ea6b -r472a3c5f359bb9b2d0aeadc7937ba2bc6aecdbc9 --- generic/nsfInt.h (.../nsfInt.h) (revision 77ba24ec459d9168dbfad4ae0c6eb4b936e8ea6b) +++ generic/nsfInt.h (.../nsfInt.h) (revision 472a3c5f359bb9b2d0aeadc7937ba2bc6aecdbc9) @@ -271,10 +271,10 @@ #if !defined(NDEBUG) # if defined(PRE86) # define ISOBJ(o) ((o) != NULL && ISOBJ_(o)) -# define ISOBJ_(o) ((o) != (void*)0xdeadbeaf && ((o)->typePtr ? (o)->typePtr->name != NULL : 1) && (o)->length >= -1 && ((o)->length > 0 ? (o)->bytes!= NULL : 1) && (o)->refCount >= 0) +# define ISOBJ_(o) ((o) != (void*)0xdeadbeaf && ((o)->typePtr ? ((o)->typePtr->name != NULL) : ((o)->bytes != NULL)) && (o)->length >= -1 && (o)->refCount >= 0) # else # define ISOBJ(o) ((o) != NULL && ISOBJ_(o)) -# define ISOBJ_(o) ((o) != (void*)0xdeadbeaf && ((o)->typePtr ? (o)->typePtr->name != NULL : 1) && ((o)->bytes != NULL ? (o)->length >= 0 : 1) && (o)->refCount >= 0) +# define ISOBJ_(o) ((o) != (void*)0xdeadbeaf && ((o)->typePtr ? (o)->typePtr->name != NULL : ((o)->bytes != NULL)) && ((o)->bytes != NULL ? (o)->length >= 0 : 1) && (o)->refCount >= 0) # endif #else # define ISOBJ(o) ((o) != NULL && ISOBJ_(o))