Overview
| Artifact ID: | a5b2538aa403d83ae89a59df13b93db12d49f5fe2c9a27238ac9785bdbf25799 |
|---|---|
| Ticket: | 723a2f4ac32c306a16919568acaf0b78304dea7d
return -code break/tailcall break from coroutine goes wrong at the top-level |
| User & Date: | aspect on 2018-07-31 13:11:32 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
Depending on the set-up, this seems to be sensitive either to the context the coroutine is created in or the context it is called in. If both have at least one frame on the stack, it works "as expected". % proc p0 {} {yield; return -code break} % coroutine c0 p0 % while 1 c0 invoked "break" outside of a loop while executing "p0" invoked from within "c0" % apply {{} {coroutine c0 p0}} % while 1 c0 % proc p1 {} {yield; tailcall break} % coroutine c1 p1 % while 1 c1 invoked "break" outside of a loop while executing "break" invoked from within "c1" % coroutine c1 p1 % apply {{} {while 1 c1}} Another fun one: $ cat itop.tcl if 1 {coroutine c0 try {yield; break}} while 1 c0 puts "ok1" coroutine c0 try {yield; break} while 1 c0 puts "ok2" $ tclsh itop.tcl ok1 invoked "break" outside of a loop while executing "try {yield; break}" invoked from within "c0" ("while" body line 1) invoked from within "while 1 c0" (file "itop.tcl" line 6) (noticed by pooryorick on the chat yesterday) - is_private changed to: "0"
- login: "aspect"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- severity changed to: "Minor"
- status changed to: "Open"
- submitter changed to: "aspect"
- subsystem changed to: "60. NRE and coroutines"
- title changed to:
return -code break/tailcall break from coroutine goes wrong at the top-level
- type changed to: "Bug"