Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 5b5c7a388fcea4df451b36ae627ab4d311b9fe4b9b0c944873a01bdb0992181a
Ticket: f4b0cb208044f175bdd669db0b293d0bf3f9108e
Calling Tcl_GetStringFromObj with NULL lengthPtr causes compile error
User & Date: anticrisis on 2021-01-22 22:38:12
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed to:
    Code introduced in tclDecls.h to handle 64 bit issues causes sqlite to fail to compile, because the new code does not allow passing NULL as a lengthPtr.
    
    Here is a godbolt link to an isolated sample. Note that calling Tcl_GetStringFromObj with 0 as the lengthPtr argument causes a compile error.
    
        https://godbolt.org/z/vxzv53
    
    The problem is this, in tclDecls.h:
    
    #define Tcl_GetStringFromObj(objPtr, sizePtr) \
    	(sizeof(*sizePtr) <= sizeof(int) ? tclStubsPtr->tcl_GetStringFromObj(objPtr, (int *)sizePtr) : tclStubsPtr->tclGetStringFromObj(objPtr, (size_t *)sizePtr))
    
    This macro fails if sizePtr is 0, because (*sizePtr) is not valid C code.
    
    Documentation for Tcl_GetStringFromObj indicates that sizePtr may be NULL, but this macro does not allow that.
    
  5. foundin changed to: "core-8-branch"
  6. is_private changed to: "0"
  7. login: "anticrisis"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "00d9ff853328848f3f7df354bd59967669224d5d"
  10. resolution changed to: "None"
  11. severity changed to: "Severe"
  12. status changed to: "Open"
  13. submitter changed to: "anticrisis"
  14. subsystem changed to: "- New Stub Entries"
  15. title changed to: "Cannot compile sqlite against core-8-branch Tcl"
  16. type changed to: "Bug"