Tcl Source Code

View Ticket
Login
Ticket UUID: 735055
Title: compile-3.5 improper test
Type: Bug Created on: 2003-05-09 06:40:53
Submitter: dgp Assigned to: msofer
Subsystem: 47. Bytecode Compiler Severity:
Priority: 5 Medium Last modified: 2003-05-09 20:44:04
Status: Closed Closed by: msofer
Resolution: Fixed Closed on: 2003-05-09 13:44:04
Version: obsolete: 8.4.2
Description:
Test compile-3.5 was added to check that
Bug 705496 was fixed.  Indeed the panic
reported there no longer happens.

But look at the test:

test compile-3.5 {...} {
    proc foo {} {
        catch {
            if {[a]} {
                if b {}
            }
        }
    }
    list [catch foo msg] $msg
} {1 {invalid command name "a"}}

Shouldn't the correct result be {0 1} and
not {1 {invalid command name "a"}} ?

Since the test currently passes, it seems
that in fact [foo] is not producing the
correct result.

I believe that saving/restoring 
envPtr->codeNext in addition to
envPtr->numCommands (done to
fix Bug 705496) will make the test
fail, but make the code do the
correct thing.
User Comments:
msofer added on 2003-05-09 20:20:34:
Logged In: YES 
user_id=148712

The reference is [Bug 705406], typo in the report.

msofer added on 2003-05-09 20:44:04:
Logged In: YES 
user_id=148712

Doh, thanks for catching that! Solution committed.