Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: a6b65768b13daead5b6796a48a2d93c42cc219e7
Ticket: 474335ffffffffffffffffffffffffffffffffff
logic of matherr is backwards
User & Date: dgp on 2001-10-24 03:45:18
Changes

  1. assignee changed to: "mdejong"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    
    A simple look at the cvs history of 
    unix/tclMtherr.c shows the introduction of
    a bug:
    
    cvs diff -r core-8-0-5 -r core-8-1-0 tclMtherr.c
    ...
    matherr(xPtr)
         struct exception *xPtr;    /* Describes error that
    occurred. */
     {
    -    if (!tcl_MathInProgress) {
    +    if (TclMathInProgress()) {
            return 0;
    ...
    
    The "!" did not survive the transition from
    access of a global variable to call of an internal
    function.  The logic of matherr() became reversed.
    The obvious fix is to restore the proper logic.
    
    It's worth pausing though and asking why this
    bug hasn't been noticed in the 3 years since it
    was introduced.  I am unable to come up with
    any script on any platform that exposes this error.
    
    It seems that Tcl behaves the same whether the
    logic is forwards or backwards.
    It would seem then that Tcl would also behave the
    same if the logic were completely removed.  I welcome
    second opinions on this, but my inclination would
    be to remove the matherr() routine altogether
    unless someone can demonstrate it's serving a
    useful purpose somewhere.  (And how useful can
    it be if it's been wrong since Tcl 8.1.0 ?)
    
    
  4. foundin changed to: "obsolete: 8.4a4"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "dgp"
  9. subsystem changed to: "52. Portability Support"
  10. title changed to: "logic of matherr is backwards"
  11. type changed to: "Bug"