Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 3e4035cb90b35f0f3b1d9fab5b806ce6ff170451
Ticket: 1122671fffffffffffffffffffffffffffffffff
SEGV in Tcl_UtfToUniChar with unaligned string
User & Date: nobody on 2007-02-08 15:57:02
Changes

  1. icomment:
    Logged In: NO 
    
    If TCL_UTF_MAX values greater than 3 will now be totally broken by this
    bug fix, the build should fail if TCL_UTF_MAX is set to 4 or larger.
    
    But it was not necessary to add such an assumption to fix this bug.
    Something as simple as:
    
             memcpy(dst, &ch, sizeof(Tcl_UniChar));
             dst += sizeof(Tcl_UniChar);
    
    would have worked just fine.
    
    The compiler knows the alignment of the respective types, and since this memcpy
    is so small, the compiler can trivially expand this inline.  So there are
    no performance regression considerations with fixing the bug this way either.
    
    
    
  2. login: "nobody"
  3. mimetype: "text/plain"
  4. username: "nobody"