Tcl Source Code

View Ticket
Login
Ticket UUID: 1978179
Title: expr panic
Type: Bug Created on: 2008-05-29 18:21:33
Submitter: dgp Assigned to: dgp
Subsystem: 47. Bytecode Compiler Severity:
Priority: 8 Last modified: 2008-06-19 04:19:06
Status: Closed Closed by: dgp
Resolution: Fixed Closed on: 2008-06-18 21:19:06
Version: obsolete: 8.4.19
Description:
% expr {eq(0)}
CompileSubExpr: token type 160584112 not TCL_TOKEN_SUB_EXPR
User Comments:
ferrieux added on 2008-05-31 17:36:16:
Logged In: YES 
user_id=496139
Originator: NO

Not reproducible in 8.5 nor 8.6 HEAD. I assumed 8.4 was frozen. What's the point ?

dgp added on 2008-06-19 03:42:29:
Logged In: YES 
user_id=80530
Originator: YES


Function names are recorded in the
Tcl_Tokens as operators, then the
operator with name "eq" expects two
arguments and only one is in the
Tcl_Token array.  CRASH

dgp added on 2008-06-19 03:56:13:
Logged In: YES 
user_id=80530
Originator: YES


The "fix" for "Bug" 1201589 created this
problem, starting in 8.4.10:


2005-05-20  Don Porter  <[email protected]>

        * generic/tclParseExpr.c:       Corrected parser to recognize all
        boolean literals accepted by Tcl_GetBoolean, including prefixes like
        "y" and "f", and to allow "eq" and "ne" as function names in the
        proper context. [Bug 1201589]

dgp added on 2008-06-19 03:59:06:
Logged In: YES 
user_id=80530
Originator: YES


And that dgp bozo who committed this
change without tests ought get a
severe lashing.

dgp added on 2008-06-19 04:04:58:
Logged In: YES 
user_id=80530
Originator: YES


hmm... not quite so evil; some tests
did make the 8.5 branch; just not
backported and not complete.

dgp added on 2008-06-19 04:19:06:
Logged In: YES 
user_id=80530
Originator: YES


"fixed" for 8.4.20 by disabling the attempt
to support functions named eq() or ne().  Clearly
no one is trying to use such things, or they'd
have noticed they are completely broken for
three years.

Anyone needing such functions should just
use Tcl 8.5+.