non-bc'ed catch and tailcall
Closed / Fixed3047235fffffffffffffffffffffffffffffffffCreated 16 years agoUpdated 16 years ago
Descriptionplain2010-08-17 20:13:22
[Moved from 3046594]
You cannot [tailcall] out of a catch-environment. Bytecompiled [catch] is working properly and tested (tailcall-12.3a/b), non-bytecompiled [catch] is neither and segfaults:
% proc foo {} {set catch catch; $catch {tailcall concat}}
% foo
Program received signal SIGSEGV, Segmentation fault.
msoferplain2010-08-18 06:45:29
Attached patch fixes this issue, but new test tailcall-12.3c reveal something strange is still amiss.
msoferplain2010-08-18 06:46:02
File Added - 383752: diff
msoferplain2010-08-18 22:47:53
Fixed in HEAD by redsigning (and simplifying) tailcall
msoferplain2010-08-18 22:47:54
allow_comments - 1
ferrieuxplain2010-08-18 23:32:37
Now does it mean that a 'tailcall tailcall tailcall' could pop back 3 levels under the nose of a [catch] in the caller's context, without being caught ?
msoferplain2010-08-18 23:40:41
Tailcall should never be able to escape a catch context. Please try it (and commit a test?).
dgpplain2010-08-18 23:56:16
confirm no crash, but either it or my expectation are
still not right:
% proc foo {} {set catch catch; $catch {tailcall concat}}
% foo
1
% set errorInfo
can't read "errorInfo": no such variable
What error is [catch] catching here? And
how can we programmatically get a hold of it?
msoferplain2010-08-19 00:51:25
Fishy:
% proc foo {} {set catch catch; list [$catch {tailcall concat} msg] $msg}
% foo
1 {tailcall called from within a catch environment}
% set errorInfo
can't read "errorInfo": no such variable
msoferplain2010-08-19 01:18:46
allow_comments - 0 Missing Tcl_LogCommandInfo ... back to the drawing board
msoferplain2010-08-19 05:34:10
allow_comments - 1 New redesign committed: [tailcall] errors out early, the command info is logged by the usual means.
Log in (anonymous is fine) to add a comment.
Attachments:
- diff [download] added by msofer on 2010-08-18 06:46:02. [details]