From: <no...@so...> - 2002-12-11 22:38:59
|
Bugs item #633204, was opened at 2002-11-04 06:05 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=633204&group_id=10894 Category: 44. Bytecode Compiler Group: 8.4.1 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) >Assigned to: miguel sofer (msofer) Summary: catch { return foo } breaks inside proc Initial Comment: In TCL 8.4.1: % info patchlevel 8.4.1 % catch { return foo } 2 % proc foo {} { catch { return foo } } % foo 0 % ??? Putting the code inside a proc changes the return value? These should return the same thing. In Tcl 8.3.3 % info patchlevel 8.3.3 % catch { return foo } 2 % proc foo {} { catch { return foo } } % foo 2 % Since the behaviour changes when the code is put inside a proc, I *suspect* a bytecode compiler bug. Details: Tcl 8.4.1 $ uname -a SunOS xxxxxxxx 5.7 Generic_106541-10 sun4u sparc SUNW,UltraSPARC-IIi-cEngine $ gcc --version 2.95.2 ---------------------------------------------------------------------- >Comment By: Don Porter (dgp) Date: 2002-12-11 17:38 Message: Logged In: YES user_id=80530 This must be a bug in the byte-compiling of [catch]. Compare with: % proc foo {} { set catch catch $catch {return foo} } % foo 2 and % proc bar {} { set script {return foo} catch $script } % bar 2 Only the literal "catch {return foo}" is causing trouble, indicating some mistaken "optimization" in the bytecode. ---------------------------------------------------------------------- Comment By: miguel sofer (msofer) Date: 2002-11-04 19:19 Message: Logged In: YES user_id=148712 Blast, bitten by bothersome bytecode bug! I do not immediately see how to fix this one :( ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=633204&group_id=10894 |