Overview
| Artifact ID: | ea02d046614818d2069d8a61bb2c4be60bcf97f982f488ece05f07ceb9bf9839 |
|---|---|
| Ticket: | 7b51dbf6ca834b4e88b4be497b08e5fb08512f65
Code using namespace exported commands not regenerated correctly |
| User & Date: | beric on 2019-05-23 07:09:54 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/x-fossil-wiki"
- comment changed to:
While experimenting if namespace exported commands were optimized as direct commands when argument is "args" and body is empty, I have found that bytecode generated for the commands were not regenerated correctly: <verbatim> namespace eval debug { proc assert {args} {} namespace export assert } namespace import ::debug::assert proc test1 {} {assert anything} </verbatim> The generated bytecode shows that the assert call is optimized: <verbatim> tcl::unsupported::disassemble proc test1 ByteCode 0x04910178, refCt 1, epoch 18, interp 0x0480C488 (epoch 18) Source "assert anything" Cmds 1, src 15, inst 3, litObjs 1, aux 0, stkDepth 1, code/src 0.00 Proc 0x049051A0, refCt 1, args 0, compiled locals 0 Commands 1: 1: pc 0-1, src 0-14 Command 1: "assert anything" (0) push1 0 # "" (2) done </verbatim> But redefining the assert command: <verbatim> proc debug::assert {args} {puts $args} </verbatim> The compile epoch has changed, but the assert call is still optimized: <verbatim> tcl::unsupported::disassemble proc test1 ByteCode 0x04910178, refCt 1, epoch 19, interp 0x0480C488 (epoch 19) Source "assert anything" Cmds 1, src 15, inst 3, litObjs 1, aux 0, stkDepth 1, code/src 0.00 Proc 0x049051A0, refCt 1, args 0, compiled locals 0 Commands 1: 1: pc 0-1, src 0-14 Command 1: "assert anything" (0) push1 0 # "" (2) done </verbatim> - foundin changed to: "8.6.9"
- is_private changed to: "0"
- login: "beric"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- severity changed to: "Critical"
- status changed to: "Open"
- submitter changed to: "beric"
- subsystem changed to: "47. Bytecode Compiler"
- title changed to:
Code using namespace exported commands not regenerated correctly
- type changed to: "Bug"