#4056 [continue] result incompat with Tcl 8.4 ?

obsolete: 8.5.0
open
Don Porter
7
2011-04-12
2008-06-30
Anonymous
No

Version tcl8.5-thread-linux-x86_64 downloaded 2008-06-12.
OS Fedora 9
Old program suddenly fails on this system. Here is a snippet that when run via wish8.5 fails with an error in the eval command. But when the next line puts is uncommented it performs the eval with no error.
###########################################3
set fong "--EVAL set wrap 490"
while { 1 } {
catch {
if { [regexp {^--EVAL(.*)} $fong waste fong ] } {
puts "fong was an EVAL"
eval $fong
##### Uncomment the next command and the eval works
##### correctly
#puts -nonewline ""
continue}
puts "Went on past"
continue
} error
if { $error != "" } {
puts "There was an error, the catch value is $error"
exit
}
puts "exiting with wrap set to $wrap"
exit
}

Discussion

1 2 > >> (Page 1 of 2)
    • priority: 5 --> 7
    • assigned_to: pvgoran --> msofer
     
  • Logged In: YES
    user_id=496139
    Originator: NO

    Hmmm, half a red herring there.
    First, notice that checking the value of the 2nd arg to [catch] without checking its return value is bad practice (possible collisions).
    Second, the whole report can be simplified to the following:

    set ev {set x 12}
    catch {eval $ev;continue} y
    puts $y ==> 12
    catch {eval {set x 13};continue} y
    puts $y ==>

    Have to check about the contract of [continue] (is it supposed to reset the interp's result ?)
    But indeed the impact of a dynamic eval is strange. Possibly an effect of compilation ?
    Since this is rather linked to basic execution than regexp, reassigning to Miguel.

     
  • Don Porter
    Don Porter
    2008-07-01

    Logged In: YES
    user_id=80530
    Originator: NO

    Can the original reporter please
    confirm this is the first time
    an interp of version Tcl 8.5 has
    been tried, and this is a Tcl 8.4
    to Tcl 8.5 change that is being
    reported?

    If the results are truly from an
    executable downloaded on June 12,
    2008, then they are not a result
    from Tcl 8.5.3 which did not
    exist until Jume 30.

     
  • Don Porter
    Don Porter
    2008-07-01

    • summary: eval after regexp fails unless followed by a puts --> [continue] result incompat with Tcl 8.4 ?
    • milestone: 829411 --> 807996
     
  • Logged In: YES
    user_id=496139
    Originator: NO

    Don, I do confirm this bug appeared on 8.5.0.
    It is platform-agnostic, you can try it for yourself ;-)

     
    • milestone: 807996 --> obsolete: 8.5.0
     
    • labels: 104249 --> 105682
     
  • Logged In: YES
    user_id=496139
    Originator: NO

    OK, this can be traced to 1.101.2.35 on 29 Aug 2006 by Don:
    The Tcl_ResetResult in [break] and [continue] gets commented out.
    But CVS history is not easy to follow with branches.
    Don or Miguel, can you explain this /* ... */ ?

    6500 : msofer 1.73 case INST_CONTINUE:
    6501 : dgp 1.101.2.35 /*
    6502 : dgp 1.101.2.5 DECACHE_STACK_INFO();
    6503 : msofer 1.73 Tcl_ResetResult(interp);
    6504 : dgp 1.101.2.5 CACHE_STACK_INFO();
    6505 : dgp 1.101.2.35 */

     
  • miguel sofer
    miguel sofer
    2008-07-01

    • assigned_to: msofer --> dgp
     
  • miguel sofer
    miguel sofer
    2008-07-01

    Logged In: YES
    user_id=148712
    Originator: NO

    That seems to have been introduced in revision 1.239, with the ChangeLog entry
    2006-07-21 Miguel Sofer <msofer@users.sf.net>
    * generic/tclExecute.c:
    * tests/execute.test (execute-9.1): dgp's fix for [Bug 1522803].
    First appeared in 8.5a6 not 8.5.0.

     
1 2 > >> (Page 1 of 2)