Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 0293d26c4ccc986d0b4838630da36245ba7a15109952d59c3921c5e022c0060d
Ticket: ba68d1e9484a3a92449fdaab4c377b534842c0e0
Errors that occur when using interp eval do not give relevant line number and filename locations
User & Date: sebres on 2025-03-06 19:12:06
Changes

  1. icomment:
    Found it: the issue has been caused by the bug in Tcl_GetReturnOptions, what sets the errorLine from rethrown error from invokehidden in AliasLoad (so it contains the line number from this proc), but without the errorInfo (which initially empty, but hereafter got filled in Tcl_GetReturnOptions by `Tcl_AddErrorInfo(interp, "")` with thrown error message...
    
    So ultimately with this 3-way transfer (interp eval -> invocation of alias AliasLoad -> calling invokehidden) it would reach the calling interpreter with non-empty errorInfo (containing the error message only, without the callstack).
    
    The wrong line within `interp eval` is therefore only an after effect of the bug in Tcl_GetReturnOptions.
    Thus fixed now in Tcl_GetReturnOptions, where it'd reset the errorLine if no errorInfo was initially thrown (before errorInfo becomes updated to error message).
    
  2. login: "sebres"
  3. mimetype: "text/x-markdown"