Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 6ace5481d8582397a06049263213501da7943bbc0f9bf9be26adf04aad4d4494
Ticket: d07f42998da94cfe0c9cebc73c5cecc63f99f421
Tcl_CreateObjCommand2 argument truncation and misleading error message
User & Date: apnadkarni on 2023-05-09 17:27:30
Changes

  1. icomment:
    With respect to call vs call2 - That is by intent. The purpose of the testcmdinfo is to test the exact C API by calling the underlying C functions without any argument checks. When the "Call" interface is used, the C API by definition cannot pass more than INT_MAX arguments (or negative ones). testcmdinfo does not check for that as a test command it expects the caller (test script) to pass arguments that match the type of the C API. Like much of the test framework, it does not check for errors on the part of the script. One can add that check to the implementation of testcmdinfo if one wishes, not to the core code.
    
    In other words, with the call command which maps to the 8.6 "int" based interfaces, it is impossible to pass more than INT_MAX arguments. You can pass negative objc (between INT_MAX and UINT_MAX) values which results in the wrong # args message. You cannot pass > INT_MAX positive values which result in "limit exceeded
    
    /Ashok
    
    /Ashok
    
  2. login: "apnadkarni"
  3. mimetype: "text/plain"