Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: f8537d28f50b9f7decd24adf2255acdf4538d3c70fa82056acfe6b18b5734544
Ticket: bd94500678e837d7ed50cf6d5000df8f38cd5e39
SEGFAULT by conversion of unicode (out of BMP) to byte-array.
User & Date: jan.nijtmans on 2019-02-06 08:15:02
Changes

  1. icomment:
    Thanks. Good point!  I'm open for suggesions for improvement, but I don't think it's so dangerous as you think: why would extensions modify 'ch' in-between? It only happens when handling out-of-BMP codes, Tcl was (up to 8.6) not prepared to handle that at all. But let's be practical.
    
    I already scanned all of the Tcl world I could find for dangerous Tcl_UtfToUniChar(), and didn't find one. You spotted the one exception I missed ...   ;-)    I bet for a bottle of Champagne that you won't find another one! (Hoping that that motivates you to do a more intensive search than that I did).
    
    One more remark: Forget my remark about producing a single byte array entry: it would violate EIAS: It influences "string length" when the internal representation  changes to bytearray. We have to wait for TIP #497, or for Don's 'pure byte array' implementation (I don't think ther's a TIP yet for this, but there is a branch): One of those will fix the EIAS problem.
    
    So, I think you can close this ticket now. Or you can take the challenge and prove me wrong: I don't think there are other places in Tcl anymore like this.
    
    Thanks!
    
  2. login: "jan.nijtmans"
  3. mimetype: "text/plain"