Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 7ad944cb4add14e64adfc08e9787bf9f2f3f34c2
Ticket: 4955f5d8a4dce006e063f924bc9709f7850ecb6a
tailcall splicing spot vs. raw TclInvokeObjectCommand
User & Date: ferrieux on 2014-05-17 18:17:22
Changes

  1. icomment:
    Starting to see the light.
    
    Single-stepping in TclSetTailCall in the offending context, shows that upon entry, TOPCB=NULL. Though I'm far from familiar enough with the NRE to even start appreciating how wrong that is... I can use a brute-force grep, which shows that the only spots where TOPCB is set are TclNRAddCallback and TclNRRunCallbacks.
    
    So it seems that LablTk's capital offense was to somehow call Tcl's evaluator *without* the NRE (which should be expected from code predating the NRE).
    
    In hindsight, it also seems normal for [tailcall] to fail when no trampoline is below. Now what ?
    
     (1) is there a vanilla-tclsh way of reproducing this situation of a "non-NRE-eval" of a proc with a tail call ?
    
     (2) instead of panicking, what about raising an error ?
    
     (3) knowing this, those luxurious tailcalls in Tk should be removed, unless there's a stronger hidden reason than "cleaner error stacks".
    
    Reactions ?
    
  2. login: "ferrieux"
  3. mimetype: "text/plain"