|
2005-06-02
| ||
| 05:19 | • Ticket [1209759fff] TclUpdateReturnInfo() panics when returning TCL_RETURN s... artifact: 3d309d60eb user: dgp | |
| 05:19 | • Closed ticket [1209759fff]. artifact: 8699994937 user: dgp | |
| 04:38 | • Ticket [1209759fff]: 6 changes artifact: 2f0399a591 user: dgp | |
| 03:50 | • Open ticket [1209759fff]. artifact: 3b5e80a8b0 user: dgp | |
| 03:33 | • Pending ticket [1209759fff]. artifact: 876961522e user: dgp | |
|
2005-05-27
| ||
| 19:36 | • Ticket [1209759fff]: 2 changes artifact: 650f327fe8 user: dkf | |
| 10:56 | • New ticket [1209759fff]. artifact: 8248eb91ff user: uring | |
TclUpdateReturnInfo() panics when returning TCL_RETURN
Closed / Fixed1209759fffffffffffffffffffffffffffffffffCreated 22 years agoUpdated 22 years ago
Descriptionplain2005-05-27 10:56:33
Have a command, say "ret", which returns the code
TCL_RETURN, for example as a proc:
proc ret {} { return -code 2 }
... and a procedure which calls "ret":
Then, running tclsh you get:
% catch ret
% 2
% ret
% foo
But, if you implement the "ret" command in C, for example,
static int
ret_cmd( ClientData, Tcl_Interp * interp, int, Tcl_Obj
* const * )
{
return TCL_RETURN;
}
you'll get tclsh oborting:
% load libret.so ;# creates the "ret" command
% proc foo {} { ret }
% catch ret
% 2
% foo
TclUpdateReturnInfo: negative return level
dkf Ticket [1209759fff]: 2 changes
[History diff]2005-05-27 19:36:58
dgpplain2005-06-02 03:33:38
Logged In: YES user_id=80530 Can't reproduce this with the current development sources. Believe this is already fixed for Tcl 8.5a3.
dgpplain2005-06-02 03:50:17
Logged In: YES user_id=80530 ok, not sure what error I made before, but I reproduce it now.
dgpplain2005-06-02 04:38:37
Logged In: YES
user_id=80530
ok, for compatibility with earlier
Tcl releases, we want
return TCL_RETURN;
to mean the same as
return Tcl_SetReturnOptions(interp, Tcl_NewObj());
Committing simple fix to achieve that.
dgpplain2005-06-02 05:19:23
Logged In: YES user_id=80530 revised fix committed that should be more efficient.
dgp Ticket [1209759fff]: 2 changes
[History diff]2005-06-02 05:19:24
Log in (anonymous is fine) to add a comment.