Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 9e1e37de8a0ee2bf689958301ccd99d523bebb8150689bae2a04a473bf7f59d1
Ticket: 90612089d8423b75a50197df1cdd29d5aef2f062
signed integer overflow in ExprRandFunc()
User & Date: jan.nijtmans on 2021-12-16 08:29:43
Changes

  1. icomment:
    > Would it be useful to introduce a PTR2ULONG() macro ...
    
    In Tcl 8.7, PTR2UINT() no longer narrows to unsigned int. Since it's just an internal macro, it's not worth to change that in 8.6: 8.7 still has some more time for possible bugs arising from that change to be found and fixed (although I don't know of any)
    
    Further on, the (unsigned long) cast doesn't do anything if the value is already an unsigned type. A few lines after that:
    <pre>
        iPtr->randSeed &= 0x7FFFFFFFL
    </pre>
    so any bits higher than 30 will be lost anyway.
    
  2. login: "jan.nijtmans"
  3. mimetype: "text/x-fossil-wiki"