Overview
| Artifact ID: | d6ec06cb6b7350acd351c5c564467120effefa1c |
|---|---|
| Ticket: | 1899164fffffffffffffffffffffffffffffffff
Cached bytecode not typed; expr vs. script |
| User & Date: | dgp on 2008-02-21 21:55:45 |
Changes
- assignee changed to: "andreas_kupries"
- cmimetype changed to: "text/plain"
- comment changed to:
The implementation of Tcl_ExprObj() tries to detect when the Tcl_Obj passed in is a PRECOMPILED "bytecode" value, and then validate interps and forgive any epoch expiration before executing the bytecode. This is incorrect, because a PRECOMPILED value has been compiled as a script to produce the bytecode, and that bytecode is not a valid set of instructions to interpret the same string as an expression. ([eval {0}] and [expr {0}] are different!) Worse still, the cleanup stages at the end of Tcl_ExprObj() will free the bytecode, and since PRECOMPILED values suppress the original string rep., the original bytecode will be lost with no way to recover it. Attached is a patch to make Tcl_ExprObj() do the only sensible thing -- raise an error. No one has noticed this, probably because it appears difficult and unnatural to pass a PRECOMPILED value to Tcl_ExprObj(), possibly even requiring internals intrusion to accomplish it. If there's a way to create a test case for this with reasonable effort in either the Tcl or the tbcload test suite, I'd appreciate that contribution. Otherwise, just review and commit this fix please. - foundin changed to: "obsolete: 8.5.1"
- is_private changed to: "0"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "dgp"
- subsystem changed to: "47. Bytecode Compiler"
- title changed to: "Tcl_ExprObj and PRECOMPILED scripts"
- type changed to: "Bug"