Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 2c264fd455c3de6a553748501a0f82044ea34d29181255f5f30492bcf25fcbf7
Ticket: 3e0a2d99f365c035ce84ec9de1e3acd80c2e2c6c
[string first] failures on 32-bit platforms
User & Date: dgp on 2018-12-12 14:06:27
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed to:
    First reported by "de" on the chat: http://paste.tclers.tk/4877
    
    ==== string-4.12.0 string first, start index FAILED
    ==== Contents of test case:
    
        run {string first \u7266 abc\u7266x 4}
    
    ---- Result was:
    4294967295
    ---- Result should have been (exact matching):
    -1
    ==== string-4.12.0 FAILED
    
    
    
    ==== string-4.8.1 string first FAILED
    ==== Contents of test case:
    
        run {string first "" x123xx345xxx789xxx012}
    
    ---- Result was:
    4294967295
    ---- Result should have been (exact matching):
    -1
    ==== string-4.8.1 FAILED
    
    
    
    ==== string-4.12.1 string first, start index FAILED
    ==== Contents of test case:
    
        run {string first \u7266 abc\u7266x 4}
    
    ---- Result was:
    4294967295
    ---- Result should have been (exact matching):
    -1
    ==== string-4.12.1 FAILED
    
    First fails with http://core.tcl.tk/tcl/info/1f55c24720
    
    But that appears to be new testing exposing an existing problem.
    
    TclStringFirst() on trunk returns size_t, but also needs to return
    the literal value -1 to signal 'not found'. That's not cleanly consistent.
    
    The caller then takes the result as input to Tcl_NewWideIntObj().
    On 32-bit systems, wide is larger than size_t and we get conversion
    to the wrong value.
    
  5. foundin changed to: "9.0a0"
  6. is_private changed to: "0"
  7. login: "dgp"
  8. priority changed to: "5 Medium"
  9. resolution changed to: "None"
  10. severity changed to: "Minor"
  11. status changed to: "Open"
  12. submitter changed to: "dgp"
  13. subsystem changed to: "10. Objects"
  14. title changed to: "[string first] failures on 32-bit platforms"
  15. type changed to: "Bug"