Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 8d105f672eef818d6bc4f2d878649cd73c8f41889b1006625004d14b21b736f6
Ticket: 76ad7aeba3e7049e392079c1aea8044d73c0ef17
boundary case bug in [string is integer]
User & Date: chrstphrchvz on 2022-05-21 21:29:10
Changes

  1. icomment:
    This behavior occurs when non-compiled <tt>StringIsCmd()</tt> is invoked (which seems to be whenever the class isn’t specified as a literal); by the time it is invoked, the value already has a bignum representation, which <tt>Tcl_GetIntFromObj()</tt> → <tt>Tcl_GetLongFromObj()</tt> extract -1 from rather than return <tt>TCL_ERROR</tt> for.
    
    So I’m inclined to think this is a bug in <tt>Tcl_GetIntFromObj()</tt> and/or <tt>Tcl_GetLongFromObj()</tt>, affecting any bignum value within &#91;18446744069414584320,18446744073709551615&#93;, i.e. &#91;(2**64-1)-(2**32-1),2**64-1&#93; (at least on LP64).
    
    There should probably be a unit test made for this.
    
  2. login: "chrstphrchvz"
  3. mimetype: "text/x-fossil-wiki"