Overview
| Artifact ID: | 76f1496e1612b6ed9247262f17c99a7ea485116c |
|---|---|
| Ticket: | 1444291fffffffffffffffffffffffffffffffff
[::unknown] and alias targets (TCL_EVAL_INVOKE) |
| User & Date: | dgp on 2006-03-06 17:29:07 |
Changes
- assignee changed to: "dgp"
- cmimetype changed to: "text/plain"
- comment changed to:
Here's a test case illustrating a problem with handling of TCL_EVAL_INVOKE flag value in TclEvalObjvInternal: test parse-8.12 {Tcl_EvalObjv procedure, TCL_EVAL_INVOKE} { set ::auto_index(noSuchCommand) { proc noSuchCommand {} {lappend ::info global} } set ::auto_index(::[string trimleft [namespace current]::test_ns_1::noSuchCo mmand :]) [list \ proc [namespace current]::test_ns_1::noSuchCommand {} { lappend ::info ns }] catch {rename ::noSuchCommand {}} set ::slave [interp create] $::slave alias bar noSuchCommand set ::info {} namespace eval test_ns_1 { $::slave eval bar } namespace delete test_ns_1 interp delete $::slave catch {rename ::noSuchCommand {}} set ::info } global The [::unknown] command is called when Tcl cannot resolve a command name. The default ::unknown proc defined in init.tcl attempts to [auto_load] a command so that the unresolved command name will resolve in future attempts. While performing thi task, the ::unknown proc assumes that the resolution context is given by: [uplevel 1 {::namespace current}] When the command name being resolved is getting eval'd because it is the target of an interp alias, this assumption is not true. TCL_EVAL_INVOKE forces resolution in ::, but swaps back to caller context before ::unknown is called. As the test demos, this can cause the wrong command to be auto-loaded, and evaled. - foundin changed to: "obsolete: 8.4.12"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "dgp"
- subsystem changed to: "45. Parsing and Eval"
- title changed to: "[::unknown] and alias targets (TCL_EVAL_INVOKE)"
- type changed to: "Bug"