Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: cd9fea39e0c0df4f8b3040f9c14efb33660cb01f9a17b7fb1a5764911c5499ef
Ticket: 8dd2807066d7cc4d8604164f39b7f0d65c0dc321
bug in single-argument 'max' with bignums
User & Date: sebres on 2025-11-10 19:48:49
Changes

  1. icomment:
    Well, it is basically a nonsense that there is a public TAKE function which modify the object in this way, and still worse all that depending on objects refCount (only).
    I'm not against the release of the internal representation of object - normally a change of internal representation may indeed happen (even for shared objects, for instance if object shimmers), but then the string representation still contain original value, so if internal representation gets needed again, it'd be reconstructed again.
    Again, freeing of internal representation on some object without string representation is bad idea at all (regardless it is shared or not) and shall be always avoided. The emphasis is on always. Just because it modifies the object drastically and because it violates EIAS concept.
    
    Therefore this issue is just an aftereffect and may happen in other cases by usage of Tcl_TakeBignumFromObj() function (also on some extensions).
    
    I have an alternative solution for this:
    
      *  8.6 related fix for Tcl_TakeBignumFromObj() - [57ed005b52d3d2c9]
      *  9.0 related fix for ExprMaxMinFunc() (and Tcl_TakeBignumFromObj()) - [./vdiff?from=21cf0e8a72462aa8&to=bug-8dd2807066d7-9.0-minmax|bug-8dd2807066d7-9.0-minmax]
    
  2. login: "sebres"
  3. mimetype: "text/x-fossil-wiki"