Skip to content
Tcl Source Code View Ticket
Login

View Ticket

logical negation of string booleans fails with TCL_MEM_DEBUG

Closed / Fixed224771ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-12-06 21:49:31
When Tcl has been compiled with TCL_MEM_DEBUG enabled, logical negation of string booleans fails (eg "set foo no; expr {!$foo}").

In addition, the comment at the start of the INST_LNOT branch in TclExecuteByteCode (line 2508) states "The operand must be numeric."  Clearly this is no longer the case, at least since the modification to support logical negation of string booleans.  The comment should have been updated at the same time that the code was changed.

Eric Melski
The Other Tcl Guy
ericm at interwoven.com
ericmplain2000-12-07 04:51:09
Donal was responsible for adding this feature:

2000-11-24  Donal K. Fellows  <[email protected]>

* generic/tclExecute.c (TclExecuteByteCode): Logical negation "!" can now handle string booleans, provided those values are placed in variables.

So he is probably best suited to correct the problem.

Eric Melski
The Other Tcl Guy
ericm at interwoven.com
dkfplain2000-12-07 18:18:30
No idea why MEM_DEBUG didn't work, but patch #102702 fixes it (I assume; it certainly passes the test suite. :^)
dkf Ticket [224771ffff]: 3 changes [History diff]2000-12-07 18:19:30
Log in (anonymous is fine) to add a comment.