Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 302d9d264cb87b367e0f0b10ca1c1b0be490d05a9f8f26f6284d2bbf990ce266
Ticket: 90612089d8423b75a50197df1cdd29d5aef2f062
signed integer overflow in ExprRandFunc()
User & Date: chrstphrchvz on 2021-12-15 22:59:36
Changes

  1. icomment:
    Multiplying by 4093 does preserve more useful bits, but it is done after the result of <tt>Tcl_GetCurrentThread()</tt> is temporarily narrowed to an <tt>unsigned int</tt>. Would it be useful to introduce a <tt>PTR2ULONG()</tt> macro, so that the result of <tt>Tcl_GetCurrentThread</tt> isn’t narrowed when <tt>sizeof(Tcl_ThreadId) == sizeof(unsigned long) &gt; sizeof(unsigned int)</tt>?
    
  2. login: "chrstphrchvz"
  3. mimetype: "text/x-fossil-wiki"